Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Make a Number system convert to convert a number of any number system to another number system. Implement only Binary, Base 5, Octal, Decimal, and Hexa number systems. Converter should be developed in Python language.

Minimize the cost of an array where


cost = summation of square of difference of two consecutive array elements.


ex:


arr = [1,2,3,4]


sum = (1-2)^2 + (2-3)^2 + (3-4)^2


Output = 3


if I insert any element in the range of (1 to 10^5) between any two items of the array then it will give some other value, like this I have to give the minimum cost possible by inserting a number.



given n and read the next n lines as integers and convert n integers as array. calculate the sum of its prefixes at each index and return the number of positive sum of prefixes.



For Example :


n = 4, next n lines 1, 3, 0, -5


read inputs as array = [-9,3,0,1,-1]


converts into _____ format Like


[3, 1, 0, -9, -1]


Then calculate sum of prefixes like


[3, 4, 4, -5,-6]


Now count the positive numbers above the list is 3.


so output is 3





Find the unique alphabet in a string and find the index of that character If multiple unique chars are in a given string, then return the first unique character index,if there is no unique alphabet then print -1


Note: index format is 1



For example :


given string: statistics


Given string having a, c as unique chars


The first unique char is a


character an index in the given string is 3 (index is 1 format)


output: 3


For example : "helloram"


unique chars = [h,e,o,r,a,m]


first one out of them is "h



Minimize the cost of an array where


cost = summation of square of difference of two consecutive array elements.


ex:


arr = [1,2,3,4]


sum = (1-2)^2 + (2-3)^2 + (3-4)^2


Output = 3



Given a string, write a code to count all palindrome sub string in a given string. Length of palindrome sub string is greater than or equal to 2.





Write a program that would print the information (name, year of joining, salary, address) of the employee by creating a class named employee.The output should be as fallow.




Name year of joining address




Robert 1994 64C- wallstreat




Sam 2000 68D- wallstreat




John 1999 26B- wallstreat

Ravan's dream is to win Tic-Tac-Toe championship.to accomplish this he practices alone at home to learn the strategies of the game . your task is to identify the cell where Ravan should place his third piece so that he wins the game. Assume that each cell in the tic-tac-toe board is marked with a number as shown in the below

tic tac toe

0 1 2

3 4 5

6 7 8

input:

The first line of input contain two space-seperated integers representing the cells where Ravan has placed his first two pieces

output:

output should be a single line integer representing the cell where ravan should place his final piece

explanation

sample Output 1 :

ravan's first two moves are 0 and 1 so he not 2 to win the game .because it will complete the first row so the out put is 2

sample Output 2 :

ravan's first two moves are 0 and 3 so he not 6 to win the game .because it will complete the first row so the out put is 6


Write a program that ask the user to enter the current year and the year of birth. Then, the program should compute the age by subtracting the year of birth from the current year and display the result (which represents the age). Use the following formula: ๐ด๐‘”๐‘’ = ๐‘๐‘ข๐‘Ÿ๐‘Ÿ๐‘’๐‘›๐‘ก ๐‘ฆ๐‘’๐‘Ž๐‘Ÿ โˆ’ ๐‘๐‘–๐‘Ÿ๐‘กโ„Ž ๐‘ฆ๐‘’๐‘Ž


how to Write a program that asks the user to enter the number of people he wants to compute the ticket price for. Then, your program should ask the user to enter the age for each person and calculate the ticket price of each entered age using the given formula, then display the result with two digits after the decimal point.๐‘‡๐‘–๐‘๐‘˜๐‘’๐‘ก ๐‘ƒ๐‘Ÿ๐‘–๐‘๐‘’ = โˆš๐‘Ž๐‘”๐‘’ + 10ย 


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS