摘要:
思想:相同数异或运算等于0; class Solution { public: int singleNumber(int A[], int n) { // IMPORTANT: Please reset any member data you declared, as // the same Sol 阅读全文
摘要:
思想:使用两个指针,一个指针每次走一步,另一个每次走两步,如果走两步的追上走一步的指针,则存在环。 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode 阅读全文
摘要:
二分查找法 class Solution { public: int searchInsert(int A[], int n, int target) { // IMPORTANT: Please reset any member data you declared, as // the same 阅读全文