<>1556. thousands separator

<>
analysis

* Split and splice from back to front , Finally, flip the output class Solution { public String thousandSeparator(int n)
{ if(n / 1000 == 0) return String.valueOf(n); // If n less than 1000, Then output directly without adding a separator
StringBuilder sb= new StringBuilder(); int count = 0; // How many digits are there now while(n > 0) {
if(count == 3) { // If there are already three , You need to add a separator , And set the number of times 0 sb.append("."); count = 0; } int temp =
n% 10; count++; sb.append(temp); n = n / 10; } return sb.reverse().toString();
} }
<>1576. Replace all question marks

<>
analysis

* One by one comparison class Solution { public String modifyString(String s) { char[] ch = s.
toCharArray(); for(int i = 0; i < ch.length; i++) { if(ch[i] == '?') {
// If the current character is ? char left = (i == 0 ? ' ' : ch[i - 1]); // Find the element on the left , And judge whether it is the first element char
right= (i == ch.length - 1 ? ' ' : ch[i + 1]); // Find the element on the right , And judge whether it is the last element char temp =
'a'; while(temp == left || temp == right) // Loop to find characters that are not the same as left and right characters temp++; ch[i] =
temp; } } return new String(ch); } }

Technology
©2020 ioDraw All rights reserved
use python Program draw some simple cartoon characters Enterprise network topology What is it L2 NormWeb Automatic test tool selection feature extraction - Feature post fusion - Multi core learning method (MKL) First order low pass filter - Continuous to discrete Java Simple login interface implementation 【socket】 case analysis c++ From c Language transition to c++AMG8833 The use of stm32 Driver code