Skip to content

Instantly share code, notes, and snippets.

@ZeeshanAdilButt
Created September 25, 2021 22:12
Show Gist options
  • Save ZeeshanAdilButt/eefd0ec7b9cff3b14d015282a31f11a7 to your computer and use it in GitHub Desktop.
Save ZeeshanAdilButt/eefd0ec7b9cff3b14d015282a31f11a7 to your computer and use it in GitHub Desktop.
a suggestion list to help you save from common errors/bug in your problems

String algorithms suggestions

  1. Make sure when looping, always start from 0 and always keep the condition of your loop less than the length of array for example: for(int i= 0; i< str.Lenght; i++){ } as we know that the arrays start at index 0, and the string array size is always greater than the last index of the element

  2. Take care of case insensitivity, read problems carefully and decide on the case insensitivity accordingly

  3. Always plan your solution according to the allowed characters, else you might end up replacing a character with a character leaving a bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment