Codingbat - frontTimes (Java)

preview_player
Показать описание
This is a video solution to the codingbat problem frontTimes from the warmup 2 section. It is a Java solution.
Рекомендации по теме
Комментарии
Автор

Hi Paul, great video like always.
I'm a little confused about the for loop regarding the 'n' variable. Why is it "i _less than_ n"? Is it because if, for example, n = 3 then you want to run the loop 2 times (NOT 3 times) to add 2 copies to the original? Thus resulting in 3 "front" substrings? Not sure if that makes sense sorry

Edit: PS. Why is it you can multiply in python (ex: str*n) but you can't in Java and require a for loop?

filippians
visit shbcf.ru