본문 바로가기

Programming107

[Hackerrank] InsertNodeAtHead www.hackerrank.com/challenges/insert-a-node-at-the-head-of-a-linked-list/problemInsert a node at the head of a linked list | HackerRankCreate and insert a new node at the head of a linked listwww.hackerrank.compackage exam.complete; //https://www.hackerrank.com/challenges/insert-a-node-at-the-head-of-a-linked-list/problem import exam.SinglyLinkedListNode; public class InsertNodeAtHead { static S.. 2020. 12. 2.
[Hackerrank] GetNodeValue www.hackerrank.com/challenges/get-the-value-of-the-node-at-a-specific-position-from-the-tail/problemGet Node Value | HackerRankGiven the head of a linked list, get the value of the node at a given position when counting backwards from the tail.www.hackerrank.compackage exam.complete; //https://www.hackerrank.com/challenges/get-the-value-of-the-node-at-a-specific-position-from-the-tail/problem im.. 2020. 12. 2.
[Hackerrank] FindMergePointofTwoLists www.hackerrank.com/challenges/find-the-merge-point-of-two-joined-linked-lists/problem Find Merge Point of Two Lists | HackerRank Given two linked lists, find the node where they merge into one. www.hackerrank.com package exam.complete; //https://www.hackerrank.com/challenges/find-the-merge-point-of-two-joined-linked-lists/problem import exam.SinglyLinkedListNode; public class FindMergePointofTwo.. 2020. 12. 2.
[Hackerrank] DeleteNode www.hackerrank.com/challenges/delete-a-node-from-a-linked-list/problem Delete a Node | HackerRank Delete a node from the linked list and return the head. www.hackerrank.com package exam.complete; //https://www.hackerrank.com/challenges/delete-a-node-from-a-linked-list/problem import exam.SinglyLinkedListNode; public class DeleteNode { static SinglyLinkedListNode deleteNode(SinglyLinkedListNode h.. 2020. 12. 2.
[Hackerrank] CompareTwoLinkedLists https://www.hackerrank.com/challenges/compare-two-linked-lists/problem Compare two linked lists | HackerRank Compare the data in two linked lists node by node to see if the lists contain identical data. www.hackerrank.com package exam.complete; //https://www.hackerrank.com/challenges/compare-two-linked-lists/problem import exam.SinglyLinkedListNode; public class CompareTwoLinkedLists { static bo.. 2020. 12. 2.
[Hackerrank] BalancedBrackets https://www.hackerrank.com/challenges/balanced-brackets/problem Arrays - DS | HackerRank Accessing and using arrays. www.hackerrank.com package exam.complete; //https://www.hackerrank.com/challenges/balanced-brackets/problem import java.util.Stack; public class BalancedBrackets { static String isBalanced(String s) { String answer = "NO"; Stack stack = new Stack(); char[] array = s.toCharArray();.. 2020. 12. 2.
[Hackerrank] reverseArray https://www.hackerrank.com/challenges/arrays-ds/problem Arrays - DS | HackerRank Accessing and using arrays. www.hackerrank.com package exam.uploaded; //https://www.hackerrank.com/challenges/arrays-ds/problem public class reverseArray { public static class Solution { // Complete the reverseArray function below. static int[] reverseArray(int[] a) { int length = a.length; int[] answer = new int[le.. 2020. 12. 2.
[Hackerrank] MaximumElement https://www.hackerrank.com/challenges/maximum-element/problemMaximum Element | HackerRankGiven three types of queries, insert an element, delete an element or find the maximum element in a stack.www.hackerrank.compackage exam.uploaded; //https://www.hackerrank.com/challenges/maximum-element/problem import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; impor.. 2020. 12. 2.
[Hackerrank] hourglassSum https://www.hackerrank.com/challenges/2d-array/problem 2D Array - DS | HackerRank How to access and use 2d-arrays. www.hackerrank.com package exam.uploaded; //https://www.hackerrank.com/challenges/2d-array/problem public class HourglassSum { public static void main(String[] args) { int[][] arr = new int[6][6]; arr = new int[][]{{-9, -9, -9, 1, 1, 1}, {0, -9, 0, 4, 3, 2}, {-9, -9, -9, 1, 2, 3}, {.. 2020. 12. 2.