Open freedom5566 opened 6 years ago
來源:https://www.codewars.com/kata/fake-binary
Given a string of digits, you should replace any digit below 5 with '0' and any digit 5 and above with '1'. Return the resulting string.
給一個字串,你要用0替換5以下的任何數字,用1替換5以上的任何數字,最後回傳字串。
P.S:5以下不包括5
來源:https://www.codewars.com/kata/fake-binary
題目:
Given a string of digits, you should replace any digit below 5 with '0' and any digit 5 and above with '1'. Return the resulting string.
給一個字串,你要用0替換5以下的任何數字,用1替換5以上的任何數字,最後回傳字串。
P.S:5以下不包括5