原创 如何在1到100的整數數組上找到缺失的數字

一、數組元素爲 1~100 內的整數,長度爲 N,且數字不重複,如何查找缺失的數字 題目:給定一數組如 [1, 2, 3, 5],如何查找出缺失的數字 4.解題思路:數字有規律,1~100 內的連續數字,只缺失一個數字,只要求和相減即可 (

原创 [Leetcode] Number of Islands 島嶼數量(JavaScript 實現)

Q: Number of Islands Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surr