何かやってみるブログ

興味をもったこと、趣味のこと、技術について色々書きます。

2022-03-17から1日間の記事一覧

LeetCode Nth Highest Salary を解いてみた

問題 https://leetcode.com/problems/nth-highest-salary/ 解いた CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT BEGIN RETURN ( # Write your MySQL query statement below. SELECT DISTINCT Salary FROM (SELECT DENSE_RANK() OVER(ORDER BY Sa…

LeetCode Implement strStr()を解いてみた

問題 https://leetcode.com/problems/implement-strstr/ 解いた # @param {String} haystack # @param {String} needle # @return {Integer} def str_str(haystack, needle) return -1 unless haystack.include? needle haystack.index(needle) end 結果