Write a function to find the longest common prefix string amongst an array of strings.
If there is no common prefix, return an empty string ""
Implement strStr().
Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
Clarification:
What should we return when needle is an empty string? This is a great question to ask during an interview.
For the purpose of this problem, we will return 0 when needle is an empty string. This is consistent to C's strstr() and Java's indexOf().
개발실 리드님께서 내 자리 쪽으로 오시길래
당연히 내 옆에 계신 팀원분에게 할 말이 있어서 오시는구나 했는데
갑자기 나에게 말을 거셨다. (띠용)
대충 대화 내용은 다음과 같다.
리드님 :
HR로부터 이번에 LINE 신규 채용 홈페이지에 인터뷰 요청이 왔다.
그런데 HR에서 기용님을 픽하였다.
혹시 짐작 가는 이유라도???
Me :
모르겠습니다...?
대답하고 생각해보니
아무래도 내가 온라인에서 여기저기서 활동하는 걸
HR에서 알고 픽한 게 아닐까 생각이 드는데 잘 모르겠다.
어찌 됐든 그렇게 인터뷰를 하기로 하였다 !
Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
Given an integer n, return true if it is a power of three. Otherwise, return false.
An integer n is a power of three, if there exists an integer x such that n == 3x.
-231 <= n <= 231 - 1
Java 언어를 사용하여 개발하다 보면
“숫자 / 영어 소문자 / 영어 대문자” 를 찾아내는 상황을 자주 접한다.
그런 상황에 유용하게 쓸 수 있는 다양한 코드들을 정리해 보았다.