原创 【雙指針】有序數組的 Two Sum

給定一個已按照升序排列 的有序數組,找到兩個數使得它們相加之和等於目標數。 函數應該返回這兩個下標值 index1 和 index2,其中 index1 必須小於 index2。 說明: 返回的下標值(index1 和 index

原创 第三次周賽A - Problem A CodeForces - 439A

Devu is a renowned classical singer. He is invited to many big functions/festivals. Recently he was invited to “All

原创 第三次周賽D - Problem D CodeForces - 369A

Valera is a lazy student. He has m clean bowls and k clean plates. Valera has made an eating plan for the next n da

原创 第三次周賽B - Problem B CodeForces - 492A

Vanya got n cubes. He decided to build a pyramid from them. Vanya wants to build the pyramid as follows: the top le

原创 第三次周賽C - Problem C CodeForces - 822A

Holidays have finished. Thanks to the help of the hacker Leha, Noora managed to enter the university of her dreams

原创 餐廳過濾器

1333.餐廳過濾器 一、 用戶通過次數 412 用戶嘗試次數 501 通過次數 418 提交次數 1317 題目難度 Medium 給你一個餐館信息數組 restaurants,其中 restaurants[i] = [idi

原创 【c++】char* char*[] char** string

char *s; s="China"; 爲什麼char*可以賦值一個字符串呢,是因爲字符串本身就是一個地址,它是首地址的地址。 char*a[]={"China","Franch","America","German"}; [

原创 27. 移除元素

給定一個數組 nums 和一個值 val,你需要原地移除所有數值等於 val 的元素,返回移除後數組的新長度。 不要使用額外的數組空間,你必須在原地修改輸入數組並在使用 O(1) 額外空間的條件下完成。 元素的順序可以改變。你不需

原创 無重複字符的最長子串

題目: 給定一個字符串,請你找出其中不含有重複字符的 最長子串 的長度。 示例 1: 輸入: “abcabcbb” 輸出: 3 解釋: 因爲無重複字符的最長子串是 “abc”,所以其長度爲 3。 示例 2: 輸入: “bbbbb”