Single Number II

https://oj.leetcode.com/proble…,承前,http://zrj.me/archives/1344,这个题目是每个数字出现三次,要求找出只出现一次的数字: Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could ……

阅读全文

Single Number

来看这个题,https://oj.leetcode.com/proble…: Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory? 第一反应就是异或,唯一需要确认的就是异……

阅读全文

Linked List Cycle

所谓拳不离手曲不离口,算法和基础不能丢。 话说三藏师徒四人辞别女儿国,再上西行路,今天来到。。。啊呸,扯远了。。 今天来看这个,https://oj.leetcode.com/proble…,题目是这么说的 Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? 这题原……

阅读全文