摘要:
题目:Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive inte... 阅读全文
摘要:
题目:Given two stringssandt, write a function to determine iftis an anagram ofs.For example,s= "anagram",t= "nagaram", return true.s= "rat",t= "car", re... 阅读全文
摘要:
题目:Given an array of integers and an integerk, find out whether there are two distinct indicesiandjin the array such thatnums[i] = nums[j]and the diff... 阅读全文
摘要:
题目:Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the ... 阅读全文
摘要:
题目:Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].N... 阅读全文