2018-01-01から1年間の記事一覧

LeetCode #16. 3Sum Closest プログラミング練習

問題: Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each input would have exactly one solution.Exampl…

海外留学: TOEFLの準備、勉強法。TOEFLで100点以上取るには? TPO練習

こんにちは。今日は私がTOEFLを準備していたころの勉強法を紹介したいと思います。 自分は大学二年後半~大学三年後半に渡って1年間準備し、最終得点は102点です。 専門授業とかには一切通っておりません。 TOEFLとは? 何点取ればいいの? どうやって受験す…

LeetCode #15. 3Sum プログラミング練習

問題: Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:The solution set must not contain duplicate triplets.Example:Given…

LeetCode #14. Longest Common Prefix プログラミング練習

問題: 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 "".Example 1:Input: ["flower","flow","flight"] Output: "fl" Example 2:Input: ["dog","racecar"…

理系海外留学: アメリカ?イギリス?オーストラリア?英語圏留学に関して

こんにちは。 今回は留学について、私が知っている事を纏めたいと思います。 何故留学? アメリカ?イギリス?オーストラリア?英語圏留学に関して アメリカ GPAとは イギリス イギリスへ提出する平均点 オーストラリア オーストラリアへ提出する平均点 帰国…

LeetCode #13. Roman to Integer プログラミング練習

問題: Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, two is written as II in Roman numeral, just two one's added together. Twelve is written…

android studioで画像をフィットさせる

最近やっと時間が出来、android studioをかじり始めています。 ItemListを使い、itemをクリックするとそのアイテムに対応した画像を新しいアクティビティで出す と言う簡単なアプリを書いていたのですがどうも出てくる画像がフィットしない。 XMLファイルの…

LeetCode #12. Integer to Roman プログラミング練習

問題: Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, two is written as II in Roman numeral, just two one's added together. Twelve is written…

LeetCode #11. Container With Most Water プログラミング練習

問題: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axi…

LeetCode #10. Regular Expression Matching プログラミング練習

問題: Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'.'.' Matches any single character. '*' Matches zero or more of the preceding element. The matching should cover the entir…

LeetCode #9. Palindrome Number プログラミング練習

問題: Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.Example 1:Input: 121 Output: true Example 2:Input: -121 Output: false Explanation: From left to right, it reads -121…

LeetCode #8. String to Integer (atoi) プログラミング練習

問題: Implement atoi which converts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this character, takes an optional ini…

LeetCode #7. Reverse Integer プログラミング練習

問題: Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123 Output: 321 Example 2:Input: -123 Output: -321 Example 3:Input: 120 Output: 21 Note: Assume we are dealing with an environment which could only store i…

LeetCode #5. Longest Palindromic Substring プログラミング練習

問題: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example 1:Input: "babad" Output: "bab" Note: "aba" is also a valid answer. Example 2:Input: "cbbd" Output: "bb" 難易…

アメリカのコンピューターサイエンス学生事情

こんにちは! 実は筆者、大学院時代はアメリカで過ごしたので私が見てきたアメリカのCS学科を記録したいと思います。 *私が見てきた事、聞いてきた事に限るので学校毎にもしかしたら違いがあるかもしれません。 学科は細かく分かれていない 日本見たく、情…

LeetCode #4. Median of Two Sorted Arrays プログラミング練習

問題: There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Example 1: nums1 = [1, 3] nums2 = [2]The median is 2.0 Example…

Leetcode #3. Longest Substring Without Repeating Characters プログラミング練習

問題: Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "b", with the length of 1.Given "pwwkew", the a…

LeetCode #2 Add Two Numbers プログラミング練習

問題: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.You may assum…

LeetCode #1 Two Sum プログラミング練習

こんにちは!初はてなブログです。日本人にはあまり馴染みのないかもしれないLeetCodeですが、実はアメリカや中国では情報系の学生なら誰もが一日一問解いていると言われる超有名練習問題です。(実はグーグルやフェイスブック等アメリカ有名企業の面接問題…