摘要:
Given a permutation which may contain repeated numbers, find its index in all the permutations of these numbers, which are ordered in lexicographical ... 阅读全文
摘要:
Given a permutation which contains no repeated number, find its index in all the permutations of these numbers, which are ordered in lexicographical o... 阅读全文
摘要:
Given n pieces of wood with length L[i] (integer array). Cut them into small pieces to guarantee you could have equal or more than k pieces with the s... 阅读全文
摘要:
Given two 32-bit numbers, N and M, and two bit positions, i and j. Write a method to set all bits between i and j in N equal to M (e g , M becomes a s... 阅读全文
摘要:
Given a directed graph, design an algorithm to find out whether there is a route between two nodes.Have you met this question in a real interview? Yes... 阅读全文
摘要:
Determine the number of bits required to flip if you want to convert integer n to integer m.Have you met this question in a real interview? YesExample... 阅读全文
摘要:
Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn't one, return 0 instead.Example 1:Given n... 阅读全文