Write a function that takes in an array of integers and returns a sorted version of that array. Use the Bubble Sort algorithm to sort the array.If you're unfamiliar with Bubble Sort, we recommend watching the Conceptual Overview section of this question's video explanation before starting to code.Sample Inputarray = [8, 5, 2, 9, 5, 6, 3]Sample Output[2, 3, 5, 5, 6, 8, 9]
Given an array of positive integers representing the values of coins in your possession, write a function that returns the minimum amount of change (the minimum sum of money) that you cannot create. The given coins can have any positive integer value and aren't necessarily unique (i.e., you can have multiple coins of the same value).For example, if you're given coins = [1, 2, 5], the minimum amount of change that you can't create is 4. If you're given no coins, the minimum amount of change that you can't create is 1.Sample Inputcoins = [5, 7, 1, 1, 2, 3, 22]Sample Output20
আবছা অন্ধকারের একটা বিশেষ দিক হচ্ছে, বাইরে থেকে হঠাৎ প্রবেশ করলে সবকিছু অন্ধকার মনে হয়. কিন্তু কিছু সময় সেখানে থাকলে, আস্তে আস্তে সব পরিষ্কার দেখা যায়. তেমনি কিছু মানুষ আছে, আবছা অন্ধকারের মতো. তাদেরকে বুঝতে হলে তাদের সাথে সময় নিয়ে মিশতে হয়.
ইউক্রেন-রাশিয়া যুদ্ব নিয়ে খুব বিপদে আছিকোন পক্ষ নিতে পারছি না কে ভালো, কে দুষ্ট বুঝতে পারছি না তবে কিছু জিনিষ স্পষ্ট হচ্ছে ইয়েমেনর আর ইউক্রেন এক না সৌদি আর রাশিয়া এক না সকিছুর সাথে স্বার্থ যোগ করে হিসেব করা হয়কে ভালো, কে দুষ্ট স্বার্থ দিয়ে বুঝতে হয়
There's an algorithms tournament taking place in which teams of programmers compete against each other to solve algorithmic problems as fast as possible. Teams compete in a round robin, where each team faces off against all other teams. Only two teams compete against each other at a time, and for each competition, one team is designated the home team, while the other team is the away team. In each competition there's always one winner and one loser; there are no ties. A team receives 3 points if it wins and 0 points if it loses. The winner of the tournament is the team that receives the most amount of points.Given an array of pairs representing the teams that have competed against each other and an array containing the results of each competition, write a function that returns the winner of the tournament. The input arrays are named competitions and results, respectively. The competitions array has elements in the form of [homeTeam, awayTeam], where each team is a string of at most 30 characters representing the name of the team. The results array contains information about the winner of each corresponding competition in the competitions array. Specifically, results[i] denotes the winner of competitions[i], where a 1 in the results array means that the home team in the corresponding competition won and a 0 means that the away team won.Sample Inputcompetitions = [ ["HTML", "C#"], ["C#", "Python"], ["Python", "HTML"],]results = [0, 0, 1]Sample Output"Python"// C# beats HTML, Python Beats C#, and Python Beats HTML.// HTML - 0 points // C# - 3 points// Python - 6 points
Write a function that takes in a non-empty array of integers that are sorted in ascending order and returns a new array of the same length with the squares of the original integers also sorted in ascending order.Sample Inputarray = [1, 2, 3, 5, 6, 8, 9]Sample Output[1, 4, 9, 25, 36, 64, 81]
Given two non-empty arrays of integers, write a function that determines whether the second array is a subsequence of the first one. A subsequence of an array is a set of numbers that aren't necessarily adjacent in the array but that are in the same order as they appear in the array. For instance, the numbers [1, 3, 4] form a subsequence of the array [1, 2, 3, 4], and so do the numbers [2, 4]. Note that a single number in an array and the array itself are both valid subsequences of the array. Sample Input array = [5, 1, 22, 25, 6, -1, 8, 10] sequence = [1, 6, -1, 10] Sample Output: true
Stevie Wonder