Question
1. Write a Scala function named shift_left that takes an array Int argument and returns an array in which all the elements are left
1. Write a Scala function named "shift_left" that takes an array Int argument and returns an array in which all the elements are left shifted by one place. For example, [2, 4, 5] left-shifted will be [4, 5, 2]. Write a main function to test your program. 2. Write a Scala function named "unique_str" that takes a string argument, removes all the characters that appeared more than once, and returns a string of unique characters. For example, "abbaac" returns "c" and "cbaaz" returns "cbz". Write a main function to test your program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
C++ Primer Plus
Authors: Stephen Prata
6th Edition
978-0321776402, 0321776402
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App