Practice Code: 003
In an array, that has been sorted in ascending order, but has been cyclically shifted, find the element that has the minimum element.
Example, [5, 6, 7, 8, 9, 10, 11, 1, 2, 3, 4]
Write an algorithm that optimally finds the minimum element in such an array.
««« Click here for solution »»»
🔥Ready to take this challenge? 🔥
#python #practiceCode #samples #interviewQuestions #numbers #algorithm
In an array, that has been sorted in ascending order, but has been cyclically shifted, find the element that has the minimum element.
Example, [5, 6, 7, 8, 9, 10, 11, 1, 2, 3, 4]
Write an algorithm that optimally finds the minimum element in such an array.
««« Click here for solution »»»
🔥Ready to take this challenge? 🔥
#python #practiceCode #samples #interviewQuestions #numbers #algorithm
GitHub
LearnPython/Tasks/0003.ipynb at master · ignani/LearnPython
Source Code and Samples from the tutorial videos. Contribute to ignani/LearnPython development by creating an account on GitHub.
#PracticeCode: 0005
Permutation: In mathematics, permutation is the act of arranging the members of a set into a sequence or order, or, if the set is already ordered, rearranging its elements—a process called permuting. Permutations differ from combinations, which are selections of some members of a set regardless of order.
Task:
Write a function, which determines whether one line is a permutation of another. Write an algorithm that optimally finishes the task.
««« Click here for the Solution »»»
🔥Ready to take this challenge? 🔥
#python #practiceCode #samples #interviewQuestions #collections #dict #algorithm
Permutation: In mathematics, permutation is the act of arranging the members of a set into a sequence or order, or, if the set is already ordered, rearranging its elements—a process called permuting. Permutations differ from combinations, which are selections of some members of a set regardless of order.
Task:
Write a function, which determines whether one line is a permutation of another. Write an algorithm that optimally finishes the task.
««« Click here for the Solution »»»
🔥Ready to take this challenge? 🔥
#python #practiceCode #samples #interviewQuestions #collections #dict #algorithm
Practice Code: 0004
Check if a palindrome can be created from a string entered by the user.
A palindrome is a word, number, phrase, or other sequence of characters which reads the same backward as forward, such as madam, racecar, or the number 10801.
"madam" => true - is already a palindrome
"mamad" => true - can be made a palindrome
"sir" => false - cannot be made a palindrome
««« Click here for the Solution »»»
🔥Ready to take this challenge? 🔥
#python #practiceCode #samples #interviewQuestions #numbers #algorithm
Check if a palindrome can be created from a string entered by the user.
A palindrome is a word, number, phrase, or other sequence of characters which reads the same backward as forward, such as madam, racecar, or the number 10801.
"madam" => true - is already a palindrome
"mamad" => true - can be made a palindrome
"sir" => false - cannot be made a palindrome
««« Click here for the Solution »»»
🔥Ready to take this challenge? 🔥
#python #practiceCode #samples #interviewQuestions #numbers #algorithm
GitHub
LearnPython/Tasks/0004.ipynb at master · ignani/LearnPython
Source Code and Samples from the tutorial videos. Contribute to ignani/LearnPython development by creating an account on GitHub.
#PracticeCode: 0006
Task:
Given a line, the words in it are indicated with a space. Print words in descending order of their length.
Input: "My favourite programming language is Python.",
Output: "programming favourite language Python My is."
Use an optimal algorithm to solve this problem.
««« Click here for the Solution »»»
🔥Ready to take this challenge? 🔥
#python #practiceCode #samples #interviewQuestions #collections #dict #algorithm
Task:
Given a line, the words in it are indicated with a space. Print words in descending order of their length.
Input: "My favourite programming language is Python.",
Output: "programming favourite language Python My is."
Use an optimal algorithm to solve this problem.
««« Click here for the Solution »»»
🔥Ready to take this challenge? 🔥
#python #practiceCode #samples #interviewQuestions #collections #dict #algorithm