Swift, Tips for solving data structure and algorithms

Tips for solving data structure and algorithm problems in Swift

Handling String

How to access character?

screenshot 2024 03 15 at 11.42.59e280afpm

You can’t access character by integer.

screenshot 2024 03 15 at 11.43.50e280afpm

You should use str.index, It’s not good.

Tip, Create a character array.

screenshot 2024 03 15 at 11.45.59e280afpm

Comments

Leave a Reply

Discover more from Shawn

Subscribe now to keep reading and get access to the full archive.

Continue reading