摘要:
/** * * @author gentleKay * Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. * 阅读全文
摘要:
/** * * @author gentleKay * Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. * For example, giv 阅读全文
摘要:
/** * * @author gentleKay * Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with t 阅读全文
摘要:
/** * * @author gentleKay * Given a binary tree, return the preorder traversal of its nodes' values. * For example: * Given binary tree{1,#,2,3}, * 1 阅读全文
摘要:
/** * * @author gentleKay * Given an array of integers, every element appears three times except for one. Find that single one. * Note: * Your algorit 阅读全文
摘要:
/** * * @author gentleKay * Merge two sorted linked lists and return it as a new list. * The new list should be made by splicing together the nodes of 阅读全文
摘要:
获取map集合中键和值的三种方式 有三种。 关于获取map集合中键和值这个用法的话,可以用到OJ题中。比如:给你一个数组,除了一个数字数量是一个,其他数字都有三个或者三个以上。就可以用Map来解决。 也可以用 ^ 运算符解决。 因为 5^5 = 0; 0^5 = 5;就可以得到答案,具体问题具体分析 阅读全文
摘要:
/** * * @author gentleKay * You are given an n x n 2D matrix representing an image. * Rotate the image by 90 degrees (clockwise). * Follow up: * Could 阅读全文
摘要:
/** * * @author gentleKay * Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: * Int 阅读全文
摘要:
/** * * @author gentleKay * The gray code is a binary numeral system where two successive values differ in only one bit. * Given a non-negative intege 阅读全文