Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Primer Plus

Authors: Stephen Prata

6th Edition

978-0321776402, 0321776402

More Books

Students also viewed these Programming questions