From 8db432b5e89d3b8e78e4e05a57598ab1021244ac Mon Sep 17 00:00:00 2001 From: SathisKumar133 <2k21cse133@kiot.ac.in> Date: Sun, 11 Aug 2024 19:11:21 +0530 Subject: [PATCH 1/3] question 11 added --- 11-integer-to-english-words.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 11-integer-to-english-words.md diff --git a/11-integer-to-english-words.md b/11-integer-to-english-words.md new file mode 100644 index 0000000..e69de29 From e704921c40c898f7773c03849d928b5475dd64a9 Mon Sep 17 00:00:00 2001 From: SathisKumar133 <2k21cse133@kiot.ac.in> Date: Mon, 12 Aug 2024 11:01:02 +0530 Subject: [PATCH 2/3] question 12 added --- 11-integer-to-english-words.md | 3 +++ 12-shortest-palindrome | 0 2 files changed, 3 insertions(+) create mode 100644 12-shortest-palindrome diff --git a/11-integer-to-english-words.md b/11-integer-to-english-words.md index e69de29..6c383e7 100644 --- a/11-integer-to-english-words.md +++ b/11-integer-to-english-words.md @@ -0,0 +1,3 @@ +## Integer to English Words + +Given a non-negative integer `num`, convert it to its English words representation. diff --git a/12-shortest-palindrome b/12-shortest-palindrome new file mode 100644 index 0000000..e69de29 From eb07a7b42eb43209163a44492c05627474963cb8 Mon Sep 17 00:00:00 2001 From: SathisKumar133 <2k21cse133@kiot.ac.in> Date: Mon, 12 Aug 2024 11:31:29 +0530 Subject: [PATCH 3/3] question 12 to 20 added --- 12-shortest-palindrome | 0 12-shortest-palindrome.md | 3 +++ 13-create-maximum-number.md | 7 +++++++ 14-self-crossing.md | 5 +++++ 15-number-of-digit-one.md | 3 +++ 16-first-missing-positive.md | 5 +++++ 17-median-of-two-sorted-arrays.md | 5 +++++ 18-word-search-II.md | 5 +++++ 19-find-the-closest-palindrome.md | 5 +++++ 20-alien-dictionary.md | 3 +++ 10 files changed, 41 insertions(+) delete mode 100644 12-shortest-palindrome create mode 100644 12-shortest-palindrome.md create mode 100644 13-create-maximum-number.md create mode 100644 14-self-crossing.md create mode 100644 15-number-of-digit-one.md create mode 100644 16-first-missing-positive.md create mode 100644 17-median-of-two-sorted-arrays.md create mode 100644 18-word-search-II.md create mode 100644 19-find-the-closest-palindrome.md create mode 100644 20-alien-dictionary.md diff --git a/12-shortest-palindrome b/12-shortest-palindrome deleted file mode 100644 index e69de29..0000000 diff --git a/12-shortest-palindrome.md b/12-shortest-palindrome.md new file mode 100644 index 0000000..684d3e2 --- /dev/null +++ b/12-shortest-palindrome.md @@ -0,0 +1,3 @@ +## Shortest Palindrome + +Given a string `s`, convert it into a palindrome by adding characters only at the front of the string. Return the shortest palindrome that can be formed by this transformation. diff --git a/13-create-maximum-number.md b/13-create-maximum-number.md new file mode 100644 index 0000000..c210835 --- /dev/null +++ b/13-create-maximum-number.md @@ -0,0 +1,7 @@ +## Create Maximum Number + +You are given two integer arrays `nums1` and `nums2` of lengths `m` and `n` respectively. These arrays represent the digits of two numbers. You are also given an integer `k`. + +Your task is to create the maximum number of length `k` (where `k ≤ m + n`) by selecting digits from the two arrays. The relative order of the digits from the same array must be preserved. + +Return an array of the `k` digits representing the maximum number. diff --git a/14-self-crossing.md b/14-self-crossing.md new file mode 100644 index 0000000..d870785 --- /dev/null +++ b/14-self-crossing.md @@ -0,0 +1,5 @@ +## Self Crossing + +You are given an array of integers `distance`. You start at the point (0, 0) on an X-Y plane, and you move `distance[0]` meters to the north, then `distance[1]` meters to the west, `distance[2]` meters to the south, `distance[3]` meters to the east, and so on. After each move, your direction changes counter-clockwise. + +Return `true` if your path crosses itself, or `false` if it does not. diff --git a/15-number-of-digit-one.md b/15-number-of-digit-one.md new file mode 100644 index 0000000..e6676fe --- /dev/null +++ b/15-number-of-digit-one.md @@ -0,0 +1,3 @@ +## Number of Digit One + +Given an integer `n`, count the total number of digit `1` appearing in all non-negative integers less than or equal to `n`. diff --git a/16-first-missing-positive.md b/16-first-missing-positive.md new file mode 100644 index 0000000..deee24a --- /dev/null +++ b/16-first-missing-positive.md @@ -0,0 +1,5 @@ +## First Missing Positive + +Given an unsorted integer array `nums`, return the smallest positive integer that is not present in `nums`. + +You must implement an algorithm that runs in O(n) time and uses O(1) auxiliary space. diff --git a/17-median-of-two-sorted-arrays.md b/17-median-of-two-sorted-arrays.md new file mode 100644 index 0000000..86a080d --- /dev/null +++ b/17-median-of-two-sorted-arrays.md @@ -0,0 +1,5 @@ +## Median of Two Sorted Arrays + +Given two sorted arrays `nums1` and `nums2` of size `m` and `n` respectively, return the median of the two sorted arrays. + +The overall run time complexity should be O(log(m + n)). diff --git a/18-word-search-II.md b/18-word-search-II.md new file mode 100644 index 0000000..61d63a8 --- /dev/null +++ b/18-word-search-II.md @@ -0,0 +1,5 @@ +## Word Search II + +Given an `m x n` board of characters and a list of strings `words`, return all words that can be found on the board. + +Each word must be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once in a word. diff --git a/19-find-the-closest-palindrome.md b/19-find-the-closest-palindrome.md new file mode 100644 index 0000000..9e0e241 --- /dev/null +++ b/19-find-the-closest-palindrome.md @@ -0,0 +1,5 @@ +## Find the Closest Palindrome + +Given a string `n` representing an integer, return the closest integer (not including itself), which is a palindrome. If there is a tie, return the smaller one. + +The closest is defined as the absolute difference minimized between two integers. diff --git a/20-alien-dictionary.md b/20-alien-dictionary.md new file mode 100644 index 0000000..86236bc --- /dev/null +++ b/20-alien-dictionary.md @@ -0,0 +1,3 @@ +## Alien Dictionary + +There is a new alien language that uses the Latin alphabet. However, the order among letters is unknown. You receive a list of non-empty words from the dictionary, where words are sorted lexicographically according to the rules of this new language. Derive the order of letters in this language.