목록분류 전체보기 (373)
Silver Library (Archived)
Though this is known as not recommended...this still works perfectly IF that is for a personal project. Radical solution:
First attempt: Unless the problem provide number to its array value, use 'method' before start thinking it from low level language. class Solution: def toLowerCase(self, s: str) -> str: ans="" for i in s: ans += i.lower() return ans ''' UpperCase = str(s) LowerCase = u converter = UpperCase < LowerCase if (Converter < s): return u else: return s '''
How to improve this code more efficiently? In other words, how to be accepted in interview? int main(void) { int scores[3]; scores[0] = get_int("Score: "); scores[1] = get_int("Score: "); scores[2] = get_int("Score: "); printf("Average: %f\n", (scores[0] + scores[1] + scores[2] / 3.0); Obviously, get_int can be replaced to something else. To reduce that repetitive one. In this case, the expert s..
Dot point: - assume each n value can be determined based on the number of iterating its value. - imagine each row and column value increases, that length is the one to decide its n value. e.g. 1 row, 1 column = [n = 1], 2 row, 2 column = [n = 2]. What Is the Runtime Complexity or Big ‘O’ Notation? You probably heard a lot about runtime complexity and how this can help you to build better code an..