leetcode brush record day009:28 and 8

28. Simple difficulty: passing rate 40% explain: What value should we return when need is an empty string? This is a good question in the interview. For this problem, we should return 0 when need is an empty string. This is consistent with the C language's str () and Java's indexOf() definitions. Question to charity: haystack and need are onl ...

Posted by cavemaneca on Thu, 23 Sep 2021 04:25:57 -0700

Python learning 3 strings and related common functions

String declaration Double quotation marks, single quotation marks, three single quotation marks, three double quotation marks There are double quotation marks inside and single quotation marks outside There are single quotation marks inside and double quotation marks outside Or use escape characters #character string m='hello' n="hello" #Ther ...

Posted by sasquatch69 on Fri, 17 Sep 2021 21:37:18 -0700

Rust: array, dynamic array, string -- thoroughly combing concepts and methods

Arrays and strings are essentially the same. They all correspond to a continuous piece of memory. In C language, a string is an unsigned char ending in a number zero   Array, that is, Rust's u8 array. C language array is a pointer. As for the size of the array, it is up to the programmer to manage it. The advantage of this is that the gra ...

Posted by storyteller on Thu, 09 Sep 2021 21:25:38 -0700