随笔分类 -  string 5

408. Valid Word Abbreviation
摘要:Given a non-empty string s and an abbreviation abbr, return whether the string matches with the given abbreviation. A string such as "word" contains only the following valid abbreviations: ["word",... 阅读全文

posted @ 2018-11-09 11:32 猪猪🐷

422. Valid Word Square
摘要:Given a sequence of words, check whether it forms a valid word square. A sequence of words forms a valid word square if the kth row and column read the exact same string, where 0 ≤ k words) { ... 阅读全文

posted @ 2018-11-08 15:43 猪猪🐷

205. Isomorphic Strings
摘要:Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrences of a character must be replaced with another c... 阅读全文

posted @ 2018-11-08 15:43 猪猪🐷

290. Word Pattern
摘要:Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str. Example... 阅读全文

posted @ 2018-11-08 15:40 猪猪🐷

443. String Compression
摘要:Given an array of characters, compress it in-place. The length after compression must always be smaller than or equal to the original array. Every element of the array should be a character (not int)... 阅读全文

posted @ 2018-11-08 15:39 猪猪🐷

271. Encode and Decode Strings
摘要:Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back to the original list of strings. Machine 1 (sender) has the function:... 阅读全文

posted @ 2018-11-08 15:37 猪猪🐷

249. Group Shifted Strings
摘要:https://www.geeksforgeeks.org/group-shifted-string/ Given a string, we can "shift" each of its letter to its successive letter, for example: "abc" -> "bcd". We can keep "shifting" which forms the s... 阅读全文

posted @ 2018-11-08 02:22 猪猪🐷

导航