Blog Day 37: ABCheck

Inseo Park·2021년 8월 13일
0

Path to Data Scientist

목록 보기
35/58
post-thumbnail

1. TIL (Today I Learned)

ABCheck

Take a string as input and return whether one of the following exists within the string.

  1. A string of length 5 starting with 'a' and ending with 'b'
  2. A string of length 5 starting with 'b' and ending with 'a'
function AbCheck(str) {
  if (str === '') {
  return false;
  
  str = str.toLowerCase(); /** this makes the 'str' to become all lowered case
  
  for(i = 4; i < str.length; i++) {
    if ((str[i] === 'a' && str[i-4] === 'b') || (str[i] === 'b' && str[i-4] === 'a')) {
    return true
    }
  }
  return false
};

2. 3 Things to be thankful for

  1. Thank God for allowing me to study and also have a good rest.
  2. Thank God for being with me always.
  3. Thank God for allowing me to rely on you not myself.

3. Ideas and things to think about.

  1. You failing in codestates will also be a good lesson. In life, everyone fails in something and this time codestates is a potential success or failure to you. That is all into God. Remember that in the olympics, people strive hard for 4 years to achieve at least 'something' which is usually a medal. However, only three people or teams get the chance to succeed in that. You failing in codestates will be a failure to you but remember that even athletes try again for 4 years to get a medal again on the next olympics. A failure is always a new start and new chance to try something new. If you fail in codestates, you can go for another trial, try google data analytics certificate alongside your university studies, or you can try new paths you want to go for. You're final goal is to become a Doctor of Philosophy in some certain criteria. For now, its PhD in Data Science. So don't put codestates as if it is a life sentence. Just enjoy the ride and try to finish the daily requirements they require you to do so. Additional work is good but not a must. Your mental health really matters.
profile
my journey to become a data scientist.

0개의 댓글