SlideShare a Scribd company logo
Use C++ for all
1) bool mapContainsKeys(array<int> numbersArray, map<int, char>itemsMap)
This function will have two parameters. The first is an array of numbers known as numbersArray.
A second is a map known as an itemsMap. The itemsMap will have keys as integers and values
as characters. The functions should return true if at least one of the numbers in the numbersArray
is a key in itemsMap. It should return false otherwise.
Example:
itemsMap: [8, 10, 5]
numbersArray: {9: 'F', 10: 'X'}
output: True
itemsMap: [8, 9, 5, 1]
numbersArray: {6: 'i', 5: 'Y', 1: 'N', 0: 'E'}
output: True
itemsMap: [9, 10, 4]
numbersArray: {5: 'i', 3: 'o', 1: 'N'}
output: False
2) map<char, int> concatenateMap(Vector<Map<char, int>>mapVector)
This function will be given a single parameter known as the mapVector. Your job is to combine all
the map found in the mapVector into a single map and return it. There are two rules for adding
values to the map:
You must add key-value pairs to the map in the same order found in the map vector.
If the key already exists, it cannot be overwritten. In other words, if two or more maps have the
same key, the key to be added cannot be overwritten by the subsequent maps.
Example:
Map Vector: [{'Z': 6, 'k': 10, 'w': 3, 'I': 8, 'Y': 5}, {'Y': 1, 'Z': 4}, {'X': 2, 'L': 5}]
Expected: {'Z': 6, 'k': 10, 'w': 3, 'I': 8, 'Y': 5, 'X': 2, 'L': 5}
Map Vector: [{'z': 0}, {'z': 7}]
Expected: {'z': 0}
Map Vector: [{'b': 7}, {'b': 10, 'A': 8, 'Z': 2, 'V': 1}]
Expected: {'b': 7, 'A': 8, 'Z': 2, 'V': 1}
3) map<char, int> uniqueValues(map<char, int>inputMap)
This function will receive a single map parameter known as inputMap. inputMap will contain a char
and integers as values. This function is supposed to search inputMap to find all values that appear
only once in the inputMap. The function will create another map named toReturn. For all values
that appear once in inputMap the function will add the value as a key in toReturn and set the value
of the key to the key of the value in inputMap (swap the key-value pairs, since inputMap contains
letters to numbers, toReturn will contain Numbers to Letters). Finally, the function should return
toReturn.
Example:
Input map: {'X': 2, 'Y': 5, 'N': 2, 'L': 2, 'W': 1, 'G': 0, 'R': 1}
Expected output: {5: 'Y', 0: 'G'}
Input map: {'Z': 3, 'P': 3, 'E': 2, 'G': 0, 'T': 5, 'L': 1, 'Q': 0}
Expected output: {2: 'E', 5: 'T', 1: 'L'}
Input map: {'E': 3, 'X': 3}
Expected output: {}
Input map: {'G': 3, 'D': 3, 'C': 4, 'Q': 1, 'H': 1, 'M': 2, 'Z': 1, 'W': 3}
Expected output: {4: 'C', 2: 'M'}
Input map: {'O': 2, 'T': 1, 'L': 5, 'W': 5, 'Z': 4, 'M': 5, 'B': 4, 'D': 0, 'F': 3, 'E': 1}
Expected output: {2: 'O', 0: 'D', 3: 'F'}

More Related Content

Similar to Use C++ for all 1 bool mapContainsKeysarrayltintgt nu.pdf

Introduction to Data Science With R Lab Record
Introduction to Data Science With R Lab RecordIntroduction to Data Science With R Lab Record
Introduction to Data Science With R Lab Record
Lakshmi Sarvani Videla
 
Virtusa questions placement preparation guide
Virtusa questions placement preparation guideVirtusa questions placement preparation guide
Virtusa questions placement preparation guide
ThalaAjith33
 
R scatter plots
R scatter plotsR scatter plots
R scatter plots
Abhik Seal
 
C++ Programming Homework Help
C++ Programming Homework HelpC++ Programming Homework Help
C++ Programming Homework Help
C++ Homework Help
 
Introduction to matlab lecture 2 of 4
Introduction to matlab lecture 2 of 4Introduction to matlab lecture 2 of 4
Introduction to matlab lecture 2 of 4
Randa Elanwar
 
Arrays and library functions
Arrays and library functionsArrays and library functions
Arrays and library functions
Swarup Boro
 
Map, Reduce and Filter in Swift
Map, Reduce and Filter in SwiftMap, Reduce and Filter in Swift
Map, Reduce and Filter in Swift
Aleksandras Smirnovas
 
Array
ArrayArray
EX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptx
EX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptxEX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptx
EX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptx
vishal choudhary
 
Basic Analysis using Python
Basic Analysis using PythonBasic Analysis using Python
Basic Analysis using Python
Sankhya_Analytics
 
CE344L-200365-Lab2.pdf
CE344L-200365-Lab2.pdfCE344L-200365-Lab2.pdf
CE344L-200365-Lab2.pdf
UmarMustafa13
 
R language tutorial.pptx
R language tutorial.pptxR language tutorial.pptx
R language tutorial.pptx
GABBARSINGH699271
 
1sequences and sampling. Suppose we went to sample the x-axis from X.pdf
1sequences and sampling. Suppose we went to sample the x-axis from X.pdf1sequences and sampling. Suppose we went to sample the x-axis from X.pdf
1sequences and sampling. Suppose we went to sample the x-axis from X.pdf
rushabhshah600
 
Arrays and strings in c++
Arrays and strings in c++Arrays and strings in c++
Arrays and strings in c++
GC University Faisalabad
 
1. Introduction.pptx
1. Introduction.pptx1. Introduction.pptx
1. Introduction.pptx
SungaleliYuen
 
Programs in array using SWIFT
Programs in array using SWIFTPrograms in array using SWIFT
Programs in array using SWIFT
vikram mahendra
 
arrays.pptx
arrays.pptxarrays.pptx
arrays.pptx
NehaJain919374
 
Array
ArrayArray
unit-2-dsa.pptx
unit-2-dsa.pptxunit-2-dsa.pptx
unit-2-dsa.pptx
sayalishivarkar1
 

Similar to Use C++ for all 1 bool mapContainsKeysarrayltintgt nu.pdf (20)

Introduction to Data Science With R Lab Record
Introduction to Data Science With R Lab RecordIntroduction to Data Science With R Lab Record
Introduction to Data Science With R Lab Record
 
Virtusa questions placement preparation guide
Virtusa questions placement preparation guideVirtusa questions placement preparation guide
Virtusa questions placement preparation guide
 
R scatter plots
R scatter plotsR scatter plots
R scatter plots
 
C++ Programming Homework Help
C++ Programming Homework HelpC++ Programming Homework Help
C++ Programming Homework Help
 
Introduction to matlab lecture 2 of 4
Introduction to matlab lecture 2 of 4Introduction to matlab lecture 2 of 4
Introduction to matlab lecture 2 of 4
 
Arrays and library functions
Arrays and library functionsArrays and library functions
Arrays and library functions
 
Map, Reduce and Filter in Swift
Map, Reduce and Filter in SwiftMap, Reduce and Filter in Swift
Map, Reduce and Filter in Swift
 
Array
ArrayArray
Array
 
EX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptx
EX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptxEX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptx
EX-6-Implement Matrix Multiplication with Hadoop Map Reduce.pptx
 
Basic Analysis using Python
Basic Analysis using PythonBasic Analysis using Python
Basic Analysis using Python
 
Qno 3 (a)
Qno 3 (a)Qno 3 (a)
Qno 3 (a)
 
CE344L-200365-Lab2.pdf
CE344L-200365-Lab2.pdfCE344L-200365-Lab2.pdf
CE344L-200365-Lab2.pdf
 
R language tutorial.pptx
R language tutorial.pptxR language tutorial.pptx
R language tutorial.pptx
 
1sequences and sampling. Suppose we went to sample the x-axis from X.pdf
1sequences and sampling. Suppose we went to sample the x-axis from X.pdf1sequences and sampling. Suppose we went to sample the x-axis from X.pdf
1sequences and sampling. Suppose we went to sample the x-axis from X.pdf
 
Arrays and strings in c++
Arrays and strings in c++Arrays and strings in c++
Arrays and strings in c++
 
1. Introduction.pptx
1. Introduction.pptx1. Introduction.pptx
1. Introduction.pptx
 
Programs in array using SWIFT
Programs in array using SWIFTPrograms in array using SWIFT
Programs in array using SWIFT
 
arrays.pptx
arrays.pptxarrays.pptx
arrays.pptx
 
Array
ArrayArray
Array
 
unit-2-dsa.pptx
unit-2-dsa.pptxunit-2-dsa.pptx
unit-2-dsa.pptx
 

More from admin447081

Problem 7 The following fraction nonconforming control char.pdf
Problem 7 The following fraction nonconforming control char.pdfProblem 7 The following fraction nonconforming control char.pdf
Problem 7 The following fraction nonconforming control char.pdf
admin447081
 
Donna and Chris Hoser have been married for three years Don.pdf
Donna and Chris Hoser have been married for three years Don.pdfDonna and Chris Hoser have been married for three years Don.pdf
Donna and Chris Hoser have been married for three years Don.pdf
admin447081
 
On January 1 2021 Pembina Corporation a publicly traded c.pdf
On January 1 2021 Pembina Corporation a publicly traded c.pdfOn January 1 2021 Pembina Corporation a publicly traded c.pdf
On January 1 2021 Pembina Corporation a publicly traded c.pdf
admin447081
 
Multinational organisations MNOs operate their activities .pdf
Multinational organisations MNOs operate their activities .pdfMultinational organisations MNOs operate their activities .pdf
Multinational organisations MNOs operate their activities .pdf
admin447081
 
Las hembras de bonobo Pan paniscus pueden ir solas e int.pdf
Las hembras de bonobo Pan paniscus pueden ir solas e int.pdfLas hembras de bonobo Pan paniscus pueden ir solas e int.pdf
Las hembras de bonobo Pan paniscus pueden ir solas e int.pdf
admin447081
 
Hawthorne almalar aadakilerin nemini ortaya kard Birini.pdf
Hawthorne almalar aadakilerin nemini ortaya kard  Birini.pdfHawthorne almalar aadakilerin nemini ortaya kard  Birini.pdf
Hawthorne almalar aadakilerin nemini ortaya kard Birini.pdf
admin447081
 
a 5 points Prove that Y the vector of fitted values is.pdf
a 5 points Prove that Y the vector of fitted values is.pdfa 5 points Prove that Y the vector of fitted values is.pdf
a 5 points Prove that Y the vector of fitted values is.pdf
admin447081
 
6 If X1X2Xn constitute a random sample of size n from a.pdf
6 If X1X2Xn constitute a random sample of size n from a.pdf6 If X1X2Xn constitute a random sample of size n from a.pdf
6 If X1X2Xn constitute a random sample of size n from a.pdf
admin447081
 
1a Cul de los siguientes no es un ejemplo de un accionist.pdf
1a Cul de los siguientes no es un ejemplo de un accionist.pdf1a Cul de los siguientes no es un ejemplo de un accionist.pdf
1a Cul de los siguientes no es un ejemplo de un accionist.pdf
admin447081
 
DEF Company also has preferred stock outstanding that pays a.pdf
DEF Company also has preferred stock outstanding that pays a.pdfDEF Company also has preferred stock outstanding that pays a.pdf
DEF Company also has preferred stock outstanding that pays a.pdf
admin447081
 
4 Explain the usage of each tool that you identified above.pdf
4 Explain the usage of each tool that you identified above.pdf4 Explain the usage of each tool that you identified above.pdf
4 Explain the usage of each tool that you identified above.pdf
admin447081
 
CASO INTEGRATIVO 30 IKEA estilo escandinavo Detrs de l.pdf
CASO INTEGRATIVO 30  IKEA estilo escandinavo  Detrs de l.pdfCASO INTEGRATIVO 30  IKEA estilo escandinavo  Detrs de l.pdf
CASO INTEGRATIVO 30 IKEA estilo escandinavo Detrs de l.pdf
admin447081
 
1 a Cul es el nombre de la esfera que se encuentra en e.pdf
1  a Cul es el nombre de la esfera que se encuentra en e.pdf1  a Cul es el nombre de la esfera que se encuentra en e.pdf
1 a Cul es el nombre de la esfera que se encuentra en e.pdf
admin447081
 
According to US Census data 716 of Americans are age 21.pdf
According to US Census data 716 of Americans are age 21.pdfAccording to US Census data 716 of Americans are age 21.pdf
According to US Census data 716 of Americans are age 21.pdf
admin447081
 
1 Sosyal medya pazarlamasn SMM kullanmann avantajlar ile .pdf
1 Sosyal medya pazarlamasn SMM kullanmann avantajlar ile .pdf1 Sosyal medya pazarlamasn SMM kullanmann avantajlar ile .pdf
1 Sosyal medya pazarlamasn SMM kullanmann avantajlar ile .pdf
admin447081
 
10 points Let continuous variables X1Xk be independentl.pdf
10 points Let continuous variables X1Xk be independentl.pdf10 points Let continuous variables X1Xk be independentl.pdf
10 points Let continuous variables X1Xk be independentl.pdf
admin447081
 
1 Provide three examples of automatic data classifications .pdf
1 Provide three examples of automatic data classifications .pdf1 Provide three examples of automatic data classifications .pdf
1 Provide three examples of automatic data classifications .pdf
admin447081
 
Theodore E Lariat is a single taxpayer born on September 22.pdf
Theodore E Lariat is a single taxpayer born on September 22.pdfTheodore E Lariat is a single taxpayer born on September 22.pdf
Theodore E Lariat is a single taxpayer born on September 22.pdf
admin447081
 
This code i would want to work ssh compiling for the this ta.pdf
This code i would want to work ssh compiling for the this ta.pdfThis code i would want to work ssh compiling for the this ta.pdf
This code i would want to work ssh compiling for the this ta.pdf
admin447081
 
Stakeholder strategySocialresponsibility AFI strategy Vis.pdf
Stakeholder strategySocialresponsibility AFI strategy    Vis.pdfStakeholder strategySocialresponsibility AFI strategy    Vis.pdf
Stakeholder strategySocialresponsibility AFI strategy Vis.pdf
admin447081
 

More from admin447081 (20)

Problem 7 The following fraction nonconforming control char.pdf
Problem 7 The following fraction nonconforming control char.pdfProblem 7 The following fraction nonconforming control char.pdf
Problem 7 The following fraction nonconforming control char.pdf
 
Donna and Chris Hoser have been married for three years Don.pdf
Donna and Chris Hoser have been married for three years Don.pdfDonna and Chris Hoser have been married for three years Don.pdf
Donna and Chris Hoser have been married for three years Don.pdf
 
On January 1 2021 Pembina Corporation a publicly traded c.pdf
On January 1 2021 Pembina Corporation a publicly traded c.pdfOn January 1 2021 Pembina Corporation a publicly traded c.pdf
On January 1 2021 Pembina Corporation a publicly traded c.pdf
 
Multinational organisations MNOs operate their activities .pdf
Multinational organisations MNOs operate their activities .pdfMultinational organisations MNOs operate their activities .pdf
Multinational organisations MNOs operate their activities .pdf
 
Las hembras de bonobo Pan paniscus pueden ir solas e int.pdf
Las hembras de bonobo Pan paniscus pueden ir solas e int.pdfLas hembras de bonobo Pan paniscus pueden ir solas e int.pdf
Las hembras de bonobo Pan paniscus pueden ir solas e int.pdf
 
Hawthorne almalar aadakilerin nemini ortaya kard Birini.pdf
Hawthorne almalar aadakilerin nemini ortaya kard  Birini.pdfHawthorne almalar aadakilerin nemini ortaya kard  Birini.pdf
Hawthorne almalar aadakilerin nemini ortaya kard Birini.pdf
 
a 5 points Prove that Y the vector of fitted values is.pdf
a 5 points Prove that Y the vector of fitted values is.pdfa 5 points Prove that Y the vector of fitted values is.pdf
a 5 points Prove that Y the vector of fitted values is.pdf
 
6 If X1X2Xn constitute a random sample of size n from a.pdf
6 If X1X2Xn constitute a random sample of size n from a.pdf6 If X1X2Xn constitute a random sample of size n from a.pdf
6 If X1X2Xn constitute a random sample of size n from a.pdf
 
1a Cul de los siguientes no es un ejemplo de un accionist.pdf
1a Cul de los siguientes no es un ejemplo de un accionist.pdf1a Cul de los siguientes no es un ejemplo de un accionist.pdf
1a Cul de los siguientes no es un ejemplo de un accionist.pdf
 
DEF Company also has preferred stock outstanding that pays a.pdf
DEF Company also has preferred stock outstanding that pays a.pdfDEF Company also has preferred stock outstanding that pays a.pdf
DEF Company also has preferred stock outstanding that pays a.pdf
 
4 Explain the usage of each tool that you identified above.pdf
4 Explain the usage of each tool that you identified above.pdf4 Explain the usage of each tool that you identified above.pdf
4 Explain the usage of each tool that you identified above.pdf
 
CASO INTEGRATIVO 30 IKEA estilo escandinavo Detrs de l.pdf
CASO INTEGRATIVO 30  IKEA estilo escandinavo  Detrs de l.pdfCASO INTEGRATIVO 30  IKEA estilo escandinavo  Detrs de l.pdf
CASO INTEGRATIVO 30 IKEA estilo escandinavo Detrs de l.pdf
 
1 a Cul es el nombre de la esfera que se encuentra en e.pdf
1  a Cul es el nombre de la esfera que se encuentra en e.pdf1  a Cul es el nombre de la esfera que se encuentra en e.pdf
1 a Cul es el nombre de la esfera que se encuentra en e.pdf
 
According to US Census data 716 of Americans are age 21.pdf
According to US Census data 716 of Americans are age 21.pdfAccording to US Census data 716 of Americans are age 21.pdf
According to US Census data 716 of Americans are age 21.pdf
 
1 Sosyal medya pazarlamasn SMM kullanmann avantajlar ile .pdf
1 Sosyal medya pazarlamasn SMM kullanmann avantajlar ile .pdf1 Sosyal medya pazarlamasn SMM kullanmann avantajlar ile .pdf
1 Sosyal medya pazarlamasn SMM kullanmann avantajlar ile .pdf
 
10 points Let continuous variables X1Xk be independentl.pdf
10 points Let continuous variables X1Xk be independentl.pdf10 points Let continuous variables X1Xk be independentl.pdf
10 points Let continuous variables X1Xk be independentl.pdf
 
1 Provide three examples of automatic data classifications .pdf
1 Provide three examples of automatic data classifications .pdf1 Provide three examples of automatic data classifications .pdf
1 Provide three examples of automatic data classifications .pdf
 
Theodore E Lariat is a single taxpayer born on September 22.pdf
Theodore E Lariat is a single taxpayer born on September 22.pdfTheodore E Lariat is a single taxpayer born on September 22.pdf
Theodore E Lariat is a single taxpayer born on September 22.pdf
 
This code i would want to work ssh compiling for the this ta.pdf
This code i would want to work ssh compiling for the this ta.pdfThis code i would want to work ssh compiling for the this ta.pdf
This code i would want to work ssh compiling for the this ta.pdf
 
Stakeholder strategySocialresponsibility AFI strategy Vis.pdf
Stakeholder strategySocialresponsibility AFI strategy    Vis.pdfStakeholder strategySocialresponsibility AFI strategy    Vis.pdf
Stakeholder strategySocialresponsibility AFI strategy Vis.pdf
 

Recently uploaded

The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 

Recently uploaded (20)

The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 

Use C++ for all 1 bool mapContainsKeysarrayltintgt nu.pdf

  • 1. Use C++ for all 1) bool mapContainsKeys(array<int> numbersArray, map<int, char>itemsMap) This function will have two parameters. The first is an array of numbers known as numbersArray. A second is a map known as an itemsMap. The itemsMap will have keys as integers and values as characters. The functions should return true if at least one of the numbers in the numbersArray is a key in itemsMap. It should return false otherwise. Example: itemsMap: [8, 10, 5] numbersArray: {9: 'F', 10: 'X'} output: True itemsMap: [8, 9, 5, 1] numbersArray: {6: 'i', 5: 'Y', 1: 'N', 0: 'E'} output: True itemsMap: [9, 10, 4] numbersArray: {5: 'i', 3: 'o', 1: 'N'} output: False 2) map<char, int> concatenateMap(Vector<Map<char, int>>mapVector) This function will be given a single parameter known as the mapVector. Your job is to combine all the map found in the mapVector into a single map and return it. There are two rules for adding values to the map: You must add key-value pairs to the map in the same order found in the map vector. If the key already exists, it cannot be overwritten. In other words, if two or more maps have the same key, the key to be added cannot be overwritten by the subsequent maps. Example: Map Vector: [{'Z': 6, 'k': 10, 'w': 3, 'I': 8, 'Y': 5}, {'Y': 1, 'Z': 4}, {'X': 2, 'L': 5}] Expected: {'Z': 6, 'k': 10, 'w': 3, 'I': 8, 'Y': 5, 'X': 2, 'L': 5} Map Vector: [{'z': 0}, {'z': 7}] Expected: {'z': 0} Map Vector: [{'b': 7}, {'b': 10, 'A': 8, 'Z': 2, 'V': 1}] Expected: {'b': 7, 'A': 8, 'Z': 2, 'V': 1} 3) map<char, int> uniqueValues(map<char, int>inputMap) This function will receive a single map parameter known as inputMap. inputMap will contain a char and integers as values. This function is supposed to search inputMap to find all values that appear only once in the inputMap. The function will create another map named toReturn. For all values that appear once in inputMap the function will add the value as a key in toReturn and set the value of the key to the key of the value in inputMap (swap the key-value pairs, since inputMap contains letters to numbers, toReturn will contain Numbers to Letters). Finally, the function should return toReturn. Example:
  • 2. Input map: {'X': 2, 'Y': 5, 'N': 2, 'L': 2, 'W': 1, 'G': 0, 'R': 1} Expected output: {5: 'Y', 0: 'G'} Input map: {'Z': 3, 'P': 3, 'E': 2, 'G': 0, 'T': 5, 'L': 1, 'Q': 0} Expected output: {2: 'E', 5: 'T', 1: 'L'} Input map: {'E': 3, 'X': 3} Expected output: {} Input map: {'G': 3, 'D': 3, 'C': 4, 'Q': 1, 'H': 1, 'M': 2, 'Z': 1, 'W': 3} Expected output: {4: 'C', 2: 'M'} Input map: {'O': 2, 'T': 1, 'L': 5, 'W': 5, 'Z': 4, 'M': 5, 'B': 4, 'D': 0, 'F': 3, 'E': 1} Expected output: {2: 'O', 0: 'D', 3: 'F'}