-
Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that th...
-
Given an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3]....
Example 1:
12Input: num...
-
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.
According to the definition of LCA...
-
123456789101112131415public class SuperPow { /** * Your task is to calculate ab mod 1337 where a is a positive intege...
-
12345678910111213141516171819202122public class DecodeWays { public int numDecodings(String s) { if (s.le...
-
123456789101112131415161718192021222324public class NumberOfDigitOne { /** * Given an integer n, count the total numb...
-
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051public class wordSearch { ...
-
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849public class IncreasingTripletSubseq...
-
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960public class K...
-
123456789101112131415161718192021222324252627282930313233343536public class WaterandJugProblem { /* You are given ...