Category: leetcode online judge
Question: Write a function to return the intersection of two arrays: For example, the intersection of and returns . The return array should only contain unique numbers and the …
Question: How to determine if a linked list has a cycle? The Singly Linked List is defined as follows: struct ListNode { int val; ListNode *next; ListNode(int x) : …
Simplify an absolute path for a file (Unix-style): For example, path = "/home/", => "/home" path = "/a/./b/../../c/", => "/c" Did you consider the case where path = “/../”? …
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, …
Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that …