随笔分类 -  string 1

8. String to Integer (atoi)
摘要:Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-white 阅读全文

posted @ 2018-08-28 20:50 猪猪🐷

Integer to Roman
摘要:Idea : remove the biggest value as I can , That’s == 0 or > 0, then append the string representation while(value > 0){ if(value - values[i] >= 0){ num 阅读全文

posted @ 2018-08-28 20:40 猪猪🐷

13. Roman to Integer
摘要:The indexOf(String target) method searches left-to-right inside the given string for a "target" string. The indexOf() method returns the index number 阅读全文

posted @ 2018-08-28 20:39 猪猪🐷

273 Integer to English Words
摘要:1,234,567 One (million) 234(thousand) 567() I = 0 Words = “” Words = helper(1,234,567 % 1000) + thousand[I = 1] + “” + words helper(1,234,567 % 1000 = 阅读全文

posted @ 2018-08-09 18:56 猪猪🐷

导航