Published April 17, 2022 by

Mail Server Using Serverless Framework AWS [Lambda + SES +IAM]

 Mail Server Using Serverless Framework On AWS [Lambda + SES +IAM]





In this article, the implementation of the MAIL Server by using the serverless Framework without doing the Changes in the AWS Account is Demonstrated Step by Step.

MAIL Server is Sending and receiving the Mail with the AWS →SES Services. as without the use of Gmail service, we can send the Mail from source to destination.

How to Deploy the Integrated Services on AWS using Serverless Framework

Pre-Requisites

  1. AWS Account

2. Nodejs

3. Programming Language (python)

4. Serverless framework

5. To Demonstrate, need 2 unique Gmail accounts.

To Begin,

Step 1:

Serverless Setup with AWS

  1. For setting up a connection with AWS, first, we need to install Serverless using CLI via NPM

#npm -g install serverless

2. Authenticating Serverless framework to Use Our AWS Account

#serverless config credentials[space] — — provider aws [space] — — key [Key in IAM] — — secret[Key in IAM] — — overwrite

3. Create a new serverless project & Select Language

#serverless

# SELECT LANGUAGE

4. Move into the newly created directory

#cd your-service-name

6. To Deploy the Serverless framework

#serverless deploy

Step 2:

Create an account in AWS using the IAM service with Full Administration Access to set up the credential to login via serverless.

Follow the Below Steps…

For creating an account using IAM in AWS

  • Go to the IAM service
  • Select users
  • Create new user
  • Give the user a name and Select the Access key
  • Give Access Power i.e, Attach Existing Policy: Administration Acess
  • Review and click on create user






Step 3:

Amazon Simple Email Service

We use the SES service for sending and receiving emails.
ADD Gmail account from which you want to send and receive the mails

steps for adding Gmail to the SES service

  • Go to SES service in AWS
  • Click on Create Identity
  • Select Email Address and Type your Email Address
  • And click on Create Identity
  • Verify your email to use it.

You need to add a minimum of two email addresses for sending and receiving mails









→ Authentication Mail Has been sent to Mail Click and Do verify.

AWS SES

Step 4:

Starting Serverless

#Serverless

Follow the below cmd to create with Serverless(SLS)

After Successfully Creating the Serverless project, Go inside the folder and edit both the handler.js and serverless.yml files.

As the actual Implementation of the Code is present in the Github

#notepad handler.js
#notepad serverless.yml

Copy Paste the code provided from the GitHub Repository.

https://github.com/Prashanth102000/SES_Mail_Server

After Editing the codes with the same folder files

Finally, you have to deploy it by the following command

#serverless deploy


CLI

Step 5 :

To Sending, mail will be using Postman Software

https://www.postman.com/downloads/

As it is a POST method, we can create a UI to post or we can POST using the Postman tool,

Open up the Postman tool → Choose the POST method → Paste the Link generated by the Serverless in the given address bar → Select RAW → Apply the Below Code with Your Created 2 unique Gmail → Click on Send



Email Sent successfully

THANK YOU




Read More
Published April 05, 2022 by

How to Create, Buy, and Sell NFTs: Beginner Guide

 In this article, We will See

How to Buy, Sell NFT's Easy Steps Guide to Beginner from Scratch. Check Out the Guide Below With the Videos to help you go through it. 
To Begin first will see What is an NFT, the Types, and the Guide to Buy, Sell and Create NFTs

    What is an NFT?

    A non-fungible token (NFT) is a non-interchangeable unit of data stored on a blockchain, a form of digital ledger, that can be sold and traded. Types of NFT data units may be associated with digital files such as photos, videos, and audio.

    Types of NFTs

    An NFT can be created, or “minted” from digital objects that represent both tangible and intangible items, including:

    • Art
    • GIFs
    • Videos and sports highlights
    • Collectibles
    • Virtual avatars and video game skins
    • Designer sneakers
    • Music

    How to Create an NFTs of any Type 

    Now will See the Step by Step by Guide on How to create an NFT,

    Go to your browser (Chrome), Open Up the Search Bar

    What you need to start creating NFTs

    • Ethereum (ERC 721) Wallet
    • a small amount of Ethereum
    • Connect your wallet to an NFT Marketplace
    • Make a Digital Art File for your NFT

    • Step 1 : Create An Ethereum Wallet
    This wallet can hold your NFTs and you’ll also need to use it to pay blockchain gas fees later on, there are hundreds of platforms that offer free cryptocurrency wallets, I suggest you go with metamask or coinbase.

    • Step 2: Purchase a small amount of Ethereum
    There are fees with converting your content into an NFT on most major digital art platforms. I’ll go over that in greater detail later, but for now, you’ll need to buy some Ethereum (ETH) to pay the expenses of making your own NFT.

    The simplest way to begin is to set a dollar amount that you are willing to spend and then purchase precisely that amount of Ethereum, I suggest you buy Nearly $50-$100 in ether (ETH). If you use Coinbase’s wallet, you can buy ether using US dollars, British pounds sterling, and other fiat currencies.

    • Step 3: Connect your wallet to an NFT Marketplace and create a marketplace:
    After you’ve set up your wallet and bought some ETH, you’ll need to choose a marketplace where you’d like to make an NFT and sell your artwork. If you’re just getting started with NFTs, I recommend starting with the open sea it had the simplest and most simple setup of any site I tried. Here’s how the process works on OpenSea.


    • Click to OpenSea to go to the website
    • Once you are in click “create” in the top right corner and select “my collections.” From there, click the blue “create” button as shown :

    How to Create, Buy, and Sell NFT (Video Tutorial)



    • Click “Create”
    When you click the “create” button, you’ll be taken to a screen where you’ll be asked to connect your Ethereum wallet. When you enter your wallet password when required, your wallet will be automatically connected to the marketplace.to prove you own the wallet address, you may need to digitally sign a message in your Ethereum wallet, but it’s just a matter of clicking through.

    There is no charge for digitally signing a message; it is just a way to demonstrate that you own the wallet.

    • Create collections:
    The next step on OpenSea is to pick “my collections” by hovering over “create” in the top right corner. Then, as seen below, click the blue “create” button.

    This step consists of you making a folder to store your newly created NFTs in , after you click on ‘create’ a window will appear that allows you to upload your artwork, Fill in your information and include a description.

    • Once you’ve chosen an image for your collection, you can move on to the next step

    add a banner image:
    as shown below once you’ve selected an image to your collection. After that, click the pen icon in the top right corner to add a banner image to the page.

    Your page should end up looking something like the image below:

    upload your first NFT Artwork
    Congrats now you have your own NFT marketplace, next, we will upload our first NFT Artwork, music, GIF, or 3D model.

    When you’re done, click “create” at the bottom of the page and sign another message in your wallet to validate the NFT’s creation. After that, the artwork can be added to your collection.

    How To Sell an NFT 

    After Uploading the NFT, or which You Already Bought an NFT
    1. Go to the Collection Section
    2. Tap Sell. 
    3. Specify the Bid Amount of that NFT
    4. Make Complete
    5. Now the NFT Will be Listed on the Network

    How To Buy an NFT 

    Choose from the collection of NFT
    1. Select BUY
    2. Go to the Wallet
    3. Add Funds 
    4. Verify the Wallet Authentication
    5. Proceed With the Complete 
    6. Now the NFT will Be Owned By you

    Conclusion

    So, to conclude, as Creating, Buying, and Selling NFTs of any type can be done on any device, I here Explained with the Metamask Wallet and the blockchain network you can choose any i.e Ethereum or the Polygon networks. Polygon Network has no gas fee when you initially Create, Buy the NFTs, it will be Collected at the Selling time of 2.5% of the value.
    So here I here choose Opensea Network as it is the largest NFT Exchange as of now with an easy User Interface that can be used without issues.
    You can Choose any Exchange and Wallet as your Need


    Read More
    Published March 27, 2022 by

    CodeChef Increase IQ Problem Code: INCRIQ Solved

    CodeChef Increase IQ Problem Code: INCRIQ Solved JAVA source Code In more Easy Comprehend Solution IQ problem Codechef

    Problem Statement

    A study has shown that playing a musical instrument helps in increasing one's IQ by 7 points. The chef knows he can't beat Einstein in physics, but he wants to try to beat him in an IQ competition.

    You know that Einstein had an IQ of 170, and Chef currently has an IQ of X.

    Determine if, after learning to play a musical instrument, Chef's IQ will become strictly greater than Einstein's.

    Print "Yes" if it is possible for Chef to beat Einstein, else print "No" (without quotes).

    Input Format

    The first and only line of input will contain a single integer X, the current IQ of Chef.

    Output Format

    For each test case, output in a single line "Yes" or "No"

    You may print each character of the string in either uppercase or lowercase (for example, the strings yEs, yes, Yes, and YES will all be treated as identical).

    Constraints

    100≤X≤169

    Subtasks

    Subtask #1 (100 points): Original constraints

    Sample Input 1 

    165

    Sample Output 1 

    Yes

    Explanation

    After learning a musical instrument, Chef's final IQ will be 165+7=172. Since 172>170, Chef can beat Einstein.

    Sample Input 2 

    120

    Sample Output 2 

    No

    Explanation

    After learning a musical instrument, Chef's final IQ will be 120+7=127. Since 127<170, Chef cannot beat Einstein.

    CodeChef Increase IQ Problem Code: INCRIQ Solved JAVA

    Read More
    Published March 21, 2022 by

    TCS CodeVita: Complete Guide | Full 2022 Questions Asked

     TCS CodeVita Complete Details Beginners

    TCS CODE VITA 2022 QUESTIONS asked in 2022 in March are GIVEN and TCS Code Vita Complete Guide is Explained in Brief in this article. TCS OCde vita for UG and PG in IT/Computers for freshers Codevita 2022 Question

      About TCS CodeVita

      CodeVita is an online Coding Competition conducted by the top MNC TCS i.e. TCS code vita 
      where the Tech Folks across the Globe do Participate Here to Solve the Competetive Programming Question.

      TCS CodeVita happens from 2012 and currently is Season 10

      TCS CodeVita Questions Pre-Qualifier round is a 6-hour Online coding challenge. You could attempt the test at your convenience within the given 24 hours of time. This round is a non-proctored round (No webcam access required).

      Benefits of TCS CodeVita

      • Global ranking to top coders
      • Top 3 coders to win total a prize money of USD 20,000/-
      • A chance to explore exciting careers* with one of the world's most powerful brand
      • A chance to compete with some of the best coders in the world
      • A platform to showcase your programming skills
      • The finalists stand a chance to travel** to India for the season 10 live grand finale experience.

      Which Programming Languages to used in TCS CodeVita?

      In TCS CodeVita the Programming Languages can be written in the following given languages C, C++, C#, Java, Perl, PHP, Python, Ruby.

      How Many Rounds Are there in TCS CodeVita?

      There are 3 rounds in TCS CodeVita Competition,
      • Pre Qualifier  -- Online
      • Qualifier -- Online
      • Grand Finale -- Online/India

      How to Participate in TCS CodeVita?

      1. Go to TCS CodeVita Official Website from TCS.
      2. Do Register to the CodeVita Website 
      3. After the Registration Time Ends, You will receive a Mail Regarding the TCS CodeVita 
      4. Later, You will get the Mock Rounds to Check and Easy Access to the CodeVita Website
      5. Finally, You will get the Date to Begin the Competition.

      What Graduation is required to be Eligible For TCS CodeVita?


      Any UG in CS/IT Domain. such as BCA, BSc, BE, B.Tech, MCA, MSc, ME, M.Tech.


      Which Batch is Eligible for TCS CodeVita?


      -2nd Year > -1 Year > CURRENT YEAR > +1 Year > +2 Year > +3 Year.

      Eg.
      Current Year:2022 
        2020, 2021, 2022, 2023, 2024 and 2025.

      Are TCS Employees Eligible for TCS CodeVita?


      No. It's Not for Folks Who are Already Being TCS Employee




      TCS Codevita Questions Asked in 2022

       1. College Rank I

      • Problem Description

      College Admissions are done by allocating a seat to a student based on his/her preference and percentage scored. Students are asked to provide three colleges of their choice. Each college will have a quota of S seats (S can vary per college). Admissions will be processed based on 'percentage scored' and availability of seats as per 'choice of preference'.

      Admissions will first be granted based on the percentage scored. If there is a tie, on the percentage scored, then admission will be granted based on student Id i.e. student with a lower Id will be given preference over a student with a higher Id.

      All admissions will be processed based on students' choice i.e. if a student is eligible to get admitted to any of the 3 colleges, s/he will have to be admitted. Similarly, it will be binding on the student to get admitted. Obviously, the first choice will get first preference, second choice will get second preference and so on.

      Find the list of students who got admitted in any college of their choice.

      • Constraints

      3<=C<=25

      1<=N<=10000

      1<=Si<=120

      • Input

      First line contains two integers viz. C and N where,

      C is number of colleges and

      N is number of students

      Second line contains C spaced integers denoting S1, S2 and so on till SC - where S1 is number of seats in college 1, S2 in college 2 etc.

      Next, N lines comprise of 5 data items, viz <student-id, percentage, Choice 1, Choice 2, Choice 3>

      • Output

      Display the students who got admitted in any college of their choice in descending order of their percentages. If there is a tie, on percentage scored, then print lower student Id ahead of higher student Id.

      The output format is <student-id college>

      For better understanding go through the Examples given below.

      Time Limit (secs)

      1

      • Examples

      Input

      3 5

      3 1 2

      Student-1,97.05,C-1,C-3,C-2

      Student-2,48.03,C-1,C-2,C-3

      Student-3,85.69,C-1,C-3,C-2

      Student-4,80.83,C-1,C-3,C-2

      Student-5,41.23,C-1,C-2,C-3

      Output

      Student-1 C-1

      Student-3 C-1

      Student-4 C-1

      Student-2 C-2

      Student-5 C-3

      Explanation

      Here student-1 with highest percentage gets his first preferred college, then the next top scorer, Student-3 gets his first preferred college and so on.

      However, we can see that there are only three seats in college 1 so only students with good percentage get admitted (i.e., student-1, student-3, student-4).

      Now college 1 allocation quota is complete. Hence no new student can be admitted to college 1. college 2 and college 3 still have one and two seats respectively. Now, Student-2 and Student-5 are yet to be admitted.

      Both student's priority is college 2 as second choice, but Student-2 is admitted to college 2 due to higher percentage (i.e., Student-2 Percentage> Student-5 Percentage).

      Now there are only 0,0,2 seats left in college 1, college 2 and college 3 respectively. So, Student-3 is admitted to college 3.

      Example 2

      Input

      4 5

      2 1 1 1

      Student-1,97.05,C-1,C-3,C-2

      Student-2,48.03,C-1,C-2,C-3

      Student-3,85.69,C-1,C-3,C-2

      Student-4,80.83,C-1,C-3,C-2

      Student-5,41.23,C-1,C-2,C-3

      Output

      Student-1 C-1

      Student-3 C-1

      Student-4 C-3

      Student-2 C-2

      Explanation

      Here allocation is done based on percentage and preference, that is student with high percentage is admitted based on his choice of preference. So, Student-1, Student-2, Student-3, Student-4 is admitted based on their score and choice. However, Student-5 is left unadmitted because all the choice of his/her colleges is full. So, Student-5 is not displayed in output.


      2. Polygon

      • Problem Description

      You are given N number of coordinates and you have to create a polygon from these points such that they will make a polygon with maximum area.

      Note: coordinates provided in the input may or may not be in sequential form.

      • Constraints

      1 <= N <= 10

      • Input

      First line contains an integer0 N which depicts number of co-ordinates

      Next N lines consist of two space separated integers depicting coordinates in the form of x y

      • Output

      Print the maximum possible area by creating a polygon by joining the coordinates. If the area is in decimal form, print the absolute value as output.

      Time Limit (secs)

      1

      Examples

      Input

      4

      0 0

      2 0

      0 2

      2 2

      Output

      4

      Explanation:

      As we can imagine that these points will make a square shape and the maximum possible area made by the polygon will be 4.

      Example 2

      Input

      5

      3 1

      0 0

      3 0

      3 3

      0 3

      Output

      9

      Explanation:

      All the coordinates will create a polygon with a maximum area of 9.


      3. Rank And Subset

      Problem Description

      You are given N comma-separated Strings. You need to form all possible legal subsets of these N strings. These subsets will be a combination of zero or more of these N Strings. After forming the subsets, they will be ranked in a particular order. The legal subset formation and ranking logic is as described below

      Rank 1 will always be an empty set

      Next N ranks will be the N Strings that appear in the order they are provided in the input

      After N + 1 ranks, you need to combine N strings such that all legal combinations are formed

      Legal combination simply means that while combinations are formed, the string that appears to the left of a particular string in the input, can never appear to the right of that particular string, when subsets are formed

      A subset with less elements will be ranked higher than a subset with more elements (NOTE:- Rank 1 is higher than rank 2)

      Refer to Example 2 to get a better understanding of how subsets are formed and ranked

      It is guaranteed that

      N >=1

      All N strings are unique

      Example, say you have an input string "aa,cc,bb". In this string there are 3 comma-separated strings. From these strings we need to create all possible legal subset of strings. 8 legal subsets can be formed from these strings. And they are as follows:

      1: {}

      2: {aa}

      3: {cc}

      4: {bb}

      5: {aa,cc}

      6: {aa,bb}

      7: {cc,bb}

      8: {aa,cc,bb}

      NOTE: - Here we can see the ranks given to the subsets are first by size i.e., the subset with lesser number of strings is ranked higher than the subset with higher size. If the subsets have equal number of strings then, the combination which is formed earlier (by virtue of combining strings in order they appear in input), gets a higher rank.

      For instance, rank of subset {aa,cc} > rank of {aa,bb} because string cc is appearing prior to string bb in the input . Similarly, rank of {cc} > rank of {bb}.

      You are provided one legal subset from all possible legal subsets. Your task is to find it's rank according to the constraints given.

      Constraints

      0 < N <= 10^2

      0 < Rank <= 10^18

      Input

      First line contains an integer N which is number of strings in group.

      Second line contains comma separated strings for which you need to find the rank.

      Third line contains N comma-separated strings basis which the subsets should be formed

      Output

      From all possible legal subsets find the rank of subset as asked in line 2 of the input

      Time Limit (secs)

      1

      Examples

      Input

      2

      a,b

      a,b

      Output

      4

      Explanation:

      Given that N = 2, given

      Second line: Rank to be find: a,b

      Third line: Given group of strings: a,b

      Possible subsets & Rank

      {} - 1

      {a} -2

      {b} - 3

      {a, b} - 4

      Output - 4 (4th rank corresponds to a,b)

      Example 2

      Input

      3

      abc,dab

      abc,dab,bc

      Output

      5

      Explanation:

      Given that N = 3, given

      Second line: Rank to be find: abc,dab

      Third line: Given group of strings: abc,dab,bc

      Possible subsets & Rank

      {} - 1

      {abc} - 2

      {dab} - 3

      {bc} - 4

      {abc,dab} - 5

      {abc,bc} - 6

      {dab,bc} - 7

      {abc,dab,bc} - 8

      Output - 5 (5th rank corresponds to abc,dab)

      Note: Here we can see the rank of {dab} < {bc} and rank of {abc,dab} < rank of {abc,bc}. Because in the input string, string dab is appearing before string bc.



      4. Docstore Offline

      Problem Description

      Docstore is a utility which is used to store documents in a file/container. And while writing or storing the file you must know the exact location of the document where you are writing it. You must know what is the starting offset and ending offset of that particular file. And these all entries are inserted into the database so that at the time of reading of file you directly start reading from that offset and return the file.

      You have been provided a list of files and its subsequent details. Soft deletion flag will be given. You can use that space to accommodate the new file. If deletion flag is 0 file is not soft deleted. You have been given a list of files with their size. You have insert file at a place where it gets the best fit.

      Best fit- Order will be

      Exact match with the free space.

      Insert where there is Least Internal fragmentation.

      If none of them is possible append after last file.

      Print the starting offset of every file inserted in sorted order of file name.

      Note- b=byte, kb=kilobytes, mb=megabyte

      Constraints

      1<N<100

      1<M<100

      Input

      First line contains an integer denoting the number of files (N) already present in the disk.

      Next lines contain space separated data about every file in the format given below

      Filename Offset Size DeletionStatus

      Next line contains an integer denoting the number of files(M) to be inserted.

      Next M lines contains space separated data about every file in the format given below

      Filename Size

      Output

      Print the starting offset of every file inserted in sorted(lexicographically) order of file name.

      Time Limit (secs)

      1

      Examples

      Input

      4

      File1 0 2b 0

      File2 2 3b 1

      File3 5 1b 0

      File4 6 4b 0

      2

      File5 2b

      File6 3b

      Output

      File5 2

      File6 10

      Explanation-

      Here we have to add file5 so will check of free spaces with exact match. But there is no exact match. Now we will check for least internal fragmentation. So file2 is deleted and we have 3b space. So, we can accommodate file5 at the position of file2 with 1b internal fragmentation.

      Now we have to insert file6 so will check of free spaces with exact match. But there is no exact match. Now we will check for least internal fragmentation. But here we don't have any space which can accommodate the file. Finally, we will add that file after the last file written. Hence it will be stored at offset 10 after file4 completion.

      Example 2

      Input

      3

      File1 0 2b 0

      File2 2 3b 0

      File3 5 1b 0

      2

      File4 1b

      File5 7b

      Output

      File4 6

      File5 7

      Explanation-

      Here we have to add file4 and file5 so will check of free spaces and all the cases but no space is present to occupy any file so they will be added at the last. One after another.


      5.Sit Together

      Problem Description

      You are a caretaker of a waiting room and you have to take care of empty seats such that all the people should sit together. Imagine the seats are in a straight line like in a movie theatre. People are seated on random seats initially. Your task is to make them sit together so that minimum number of people change their position. Also, they can be made to sit together in many ways. Find the number of ways you can make them sit together by requiring only minimal people movement.

      "E" depicts an empty seat and "O" depicts an occupied seat. Input will be given in the form of a string.

      Example: OEOEO

      As we can see, only seat number 1, 3, 5 are occupied and 2 and 4 are empty.

      Case 1: If we move 5th person to 2nd position, they can all be together with only one person moving his/her place.

      Case 2: If we move 1st person to 4th position, they can all be together with only one person moving his/her place.

      They can all be together with only one movement and this can be done in 2 ways. Print the minimum number of movements required and the number of ways this minimum movement can help achieve the objective.

      Note: If they are already sitting together, Print "0 0" as output.

      Constraints

      0 < N <= 100000

      Input

      First line contains an integer N which depicts the number of seats

      Second line contains N characters each of which are either "O" or "E". "O" denotes an occupied seat and "E" denotes an empty seat.

      Output

      Print minimum number of movements required and the number of ways in which all people can be made to sit together without exceeding minimum number of movements by space.

      Time Limit (secs)

      1

      Examples

      Input

      5

      OEOEO

      Output

      1 2

      Explanation:

      Given data of 5 seats in the queue,

      Seat number 2 and 4 are unoccupied and all the other seats are occupied.

      We can make them sit together by moving only one person near to the other. It can be done in 2 ways:

      OOOEE {Moving 4th person to 2nd position}

      EEOOO {Moving 1st person to 4th position}

      Example 2

      Input

      2

      OO

      Output

      0 0

      Explanation:

      All seats are occupied and all of them are sitting together. So, output will be 0 0.


      6. IPL

      Problem Description

      The Indian Premier League (IPL) is a professional Twenty20 cricket league, contested by eight teams based out of eight Indian cities. IPL is going to start and, in this season, you have been given the responsibility to maintain the score board of the league. You have been provided the result of each match. Total 8 teams compete (MI, CSK, RCB, RR, SRH, DC, PKBS, KKR) for winning the title. Each team will play two matches with every other team before playoffs. So, the total number of matches before playoffs will be 56 league matches.

      The format in which the scores will be given is - the runs scored by team batting first followed by the fall of wickets followed by the number of balls played. The same data will be provided for team batting second.

      For example-

      Abstract Format - FirstTeamName Runs/Wickets BallsPlayed SecondTeamName Runs/Wickets BallsPlayed

      Actual Record - MI 191/10 110 CSK 190/4 120

      Here MI scored 191 runs in110 balls at the loss of 10 wickets and CSK scored 190 runs at the loss of 4 wickets in 120 balls.

      The points table is to be constructed based on the given inputs. The points table contains <TeamName, TotalPointsScored by team, and NRR (Net Run Rate)>. The order in which teams will be present is based on the ranking. Ranking of teams is first based on number of points and then on NRR, in case the points are tied.

      The points table formation rules are given below-

      The team winning the match will get 2 points.

      NET RUN RATE is calculated as follows:

      Case 1: When both teams make same score. Each team is rewarded with 1 point each and run rate is zero for both the teams.

      Case 2: Team batting first wins the match

      In this scenario, the margin of runs by which team wins are multiplied by 0.05 and we get run rate of the match.

      Run rate= (Runs Difference) *0.05

      Case 3: Team Batting second wins the match.

      In this scenario total runs which would have been scored by the winning team if it had batted 20 overs (120 balls) are calculated and the difference with the first team is taken.

      run rate= (Projected score of winning team - score of losing team) *0.05

      For example - team1 = 159 and team2 scores 160 in 96 balls (16.0 overs). Here, team2 scored 160 runs in 96 balls so runs that can be scored in 120 balls is 200. So, the projected score for team2 is 200.

      The winning teams gets positive RR and the losing team gets negative RR.

      Net Run rate= sum of run rate of individual matches/total number of matches.

      Note - There are no test cases where the teams have same points and same NRR by the end of league matches.

      For reference about Cricket and IPL

      Cricket T20 - https://en.wikipedia.org/wiki/Twenty20

      IPL- https://en.wikipedia.org/wiki/Indian_Premier_League

      Constraints

      N=56 where N is the number of league matches

      Input

      It contains 56 lines which represent the result for every match in the format provided in problem description

      Output

      Print the ranking of all the team in points table. Sort order should be points scored, followed by NRR.

      Time Limit (secs)

      1

      Examples

      Input

      MI 206/9 120 DC 164/4 120

      RR 197/9 120 SRH 176/10 120

      CSK 130/3 120 DC 111/9 120

      KKR 217/1 120 DC 190/9 120

      SRH 163/8 120 PBKS 167/7 104

      MI 167/5 120 RR 171/5 86

      CSK 201/6 120 SRH 135/9 120

      KKR 207/8 120 DC 178/4 120

      CSK 121/9 120 RCB 125/8 79

      KKR 176/3 120 PBKS 153/9 120

      MI 193/1 120 KKR 142/3 120

      CSK 118/3 120 KKR 122/1 66

      RR 156/4 120 DC 135/6 120

      SRH 143/6 120 PBKS 128/1 120

      MI 143/7 120 RCB 147/2 109

      SRH 201/8 120 DC 205/4 88

      DC 115/2 120 RCB 119/4 71

      MI 215/10 99 DC 111/9 120

      RR 137/9 120 DC 112/7 120

      MI 164/2 120 RCB 168/4 90

      KKR 203/7 120 SRH 113/4 120

      MI 134/7 120 PBKS 123/4 120

      KKR 112/4 120 RR 116/4 94

      MI 128/6 120 KKR 132/6 110

      CSK 122/6 120 KKR 126/3 69

      RR 210/4 120 PBKS 113/1 120

      CSK 187/1 120 RR 151/3 120

      SRH 216/7 120 RCB 131/5 120

      KKR 121/3 120 RCB 125/3 103

      MI 131/8 120 SRH 135/6 79

      CSK 199/8 120 SRH 148/10 120

      MI 169/9 120 CSK 140/9 120

      CSK 191/6 120 RR 110/2 120

      MI 140/10 71 SRH 144/5 87

      RR 159/10 106 RCB 157/10 120

      PBKS 131/3 120 DC 135/3 89

      CSK 206/7 120 RCB 156/5 120

      PBKS 112/5 120 RCB 116/7 62

      RR 211/10 67 RCB 143/5 120

      KKR 190/3 120 SRH 176/10 120

      PBKS 113/9 120 RCB 117/7 84

      RR 164/5 120 PBKS 127/9 120

      CSK 147/10 117 DC 151/1 72

      SRH 171/8 120 DC 142/10 120

      KKR 209/8 120 PBKS 182/7 120

      CSK 205/6 120 PBKS 190/3 120

      MI 154/3 120 PBKS 147/5 120

      KKR 218/9 120 RCB 140/6 120

      MI 118/9 120 RR 122/7 83

      SRH 178/2 120 RCB 131/8 120

      DC 146/3 120 RCB 140/4 120

      CSK 151/2 120 PBKS 126/7 120

      MI 128/9 120 CSK 132/1 81

      PBKS 171/2 120 DC 162/3 120

      KKR 130/5 120 RR 134/10 102

      RR 133/8 120 SRH 137/2 99

      Output

      RR

      KKR

      CSK

      RCB

      SRH

      MI

      DC

      PBKS

      Explanation-

      In this case RR, KKR, CSK, RCB, SRH, MI, DC, PBKS has won 11, 10, 9, 7, 7, 6, 4, 2 matches respectively. SRH and RCB has same number of points but the NRR of RCB is higher than SRH so its rank is above SRH.



      Read More
      Published March 10, 2022 by

      3n+1 problem solution In JAVA Source Code

      3n+1 problem solution in Java source Code

       Hello, Guys In this Article I have Solved the 3n+1 Problem


      3N+1 Problem Solution in Java :

      The 3N+1 problem is an abstract mathematical problem that is a conjecture (not yet proven). It is also known as the Collatz problem. In this section, we will discuss the 3N+1 problem along with its Java program.

      The task is to write a Java program that will read a positive integer from the user and will print the 3N+1 sequence starting from that integer. The program should also count and print the number of terms in the sequence.

      • Finding the 3N+1 Sequence
      • Given a positive integer, N, define the 3N+1 sequence starting from N as follows:
      • If N is an even number, then divide N by two.
      • If N is an odd number, then multiply N by 3 and add 1.
      • Continue to generate numbers in this way until N becomes equal to 1.
      • Mathematically, we can define the 3N+1 problem as follows:

      • 3n+1 problem solution In JAVA Source Code

      3N+1 Problem in Java

      Let's understand the problem statement through an example.

      Suppose, N = 3, which is an odd number. According to the above rule, multiply N by 3 and add 1, we get N = 3*3+1 = 10. Therefore, N becomes an even number. Now, divide N by 2. It gives N = 10/2 = 5. Continue the process until N becomes equal to 1. Hence, the 3N+1 sequence will be 3, 10, 5, 16, 8, 4, 2, 1.


      Source Code (JAVA) :


      3n+1 problem solution In JAVA Source Code



      Read More
      Published March 10, 2022 by

      Infosys operations executive: Interview Q&A Real freshers

       Infosys operations executive interview questions and answers for freshers

      Infosys Operation Executive Interview

      Infosys operations executive interview questions and answers


      Duration 19mins |  BCA |  Operation Executive | Virtual

      1. ID Card Verification (Govt. ID Proof)
        • I have Shown the Driving License. It could be any Valid Govt ID (Aadhar/PAN/DL/Voter ID)
      2. Interviewer Introduced Himself to Me--!
      3. Tell me About yourself & Your Projects  done in your UG
        • Hi Sir/Mam Good Evening, I am (Name) Born and Bought Up in Bangalore.
        • Coming to my Educational Background,  I have Pursued My BCA Degree at XYZ College, Bangalore with an aggregate percentage of 89%. and I completed My PUC/12th in the XYZ College with 80% in the Science Stream. and I did My schooling in the XYZ School with 78%. 
        • I have Done Projects in my BCA, Title (Securing cloud data under Key Exposure) On the Technology JAVA Based Web Application
        • I belong to a Nuclear family where I have a brother and a Sister
        • My Strengths are I'm Very Much Dedicated to my Work and I'm a quick Learner
        • My weakness is Overthink of some and I focus too much on the Details
        • So This is about me Sir/Mam
      4. Are you a quick Learner? How would you say you are a quick Learner?
        • Yes, Sir I Will Say I am a Quick Learner one such I would say, for Example, During my Project, I am Unaware of the tools and technologies to be used for project I Analysed the resources and learned and I used in my Project to Build.
      5. Scenario: Assume that you have been given 10 assignments to complete, How do you handle that,? Will you accept that work to complete? What is your view?  (5 Questions on the Scenario)
        • Yes, I will Sure Accept It, and I will look into the details on the given task/Assignments that Whether I have an Idea or Knowledge of the assignments given. If I was Known I would complete the given task.
          • How could Handle? , If I'm not aware of the technology to be used in my assignments I will try to learn from the internet or I would ask my colleagues to assist or I would ask My Team head to assist with my problem 
          • How many Days, First I will Complete the Short Assignments works and I would go for the Long one and also 
      6. I asked the duration, he said "Irrespective of the duration, you're not given duration, how do you handle that ?".
        • If the assignments are given a Deadline, I will look into first whether I could complete them in the given timeline or not, If I need some more time I would Request that I required some more time to finish my work 
      7. Why Infosys?
        • As to My Analyse INFOSYS, is a Big MNC in India and I heard here the training given to the freshers here are Fabulous and the Work Environments are Good, So I believe that I will for sure learn some which I am not aware and more Technologies and Work-life here well and which also helps mine in the career growth.
        •  These are who intends to join Infosys
      8. What do you want to work with Infosys?
        •  I believe that I will for sure learn some of which I am not aware of and more about Technologies and Work-life here well and which also helps mine in the career growth.
      9. What are the qualities you think you have to join Infosys?
        • Discipline 
        • Trust 
        • Willingness to Learn 
        • Time-Management
        • So these are which I have and I think to join Infosys
      10. Have you been to any Social Work activities? What was your role in that? What all you did in that?
        • I was been the KCD(Friends of Police), where I have Attended Events, and helped people as we are a team which we did in the team to help the people and do Camping.
      11. Any Questions you need to ask me?
        • Nothing sir, How I did my Interview and How I enhance my mistakes.
        • He Said, learn some of the programming languages (Python, Java, JS)
      12. Thank You! 

      Check Out:


      Follow Us For More:

      Youtube Channel: Tech Network

      Freshers Interviews Experiences: https://freshersinterviews.quora.com/

      Read More
      Published March 08, 2022 by

      Infosys Operation Executive TR & HR Questions | OFFER LETTER

      Infosys Operation Executive

      Infosys Operation Executive Interview Questions & Offer Letter

      In this article, I have shared the Infosys Operation Executive Interview Experience

      This Interview happens Online the TR and HR & Infosys Operations Executive Salary for Freshers

      Infosys Operation Executive Interview Questions & Offer Letter


        Infosys Operation Executive Role BCA, B. Sc (Maths, Statistics, Physics, Chemistry, Electronics, Biochemistry, Computer Science, IT), B. Voc in CS / IT from the year of passing 2020, 2021 & 2022




        2. INFOSYS Offer letter (Vital Points)

        INFOSYS LTD.

        Basic Details:

        1. You have been selected for the position of Operations Executive - Trainee.
        2. Operation executive in Infosys salary Rs.2,22,972/- per annum CTC Given for the Selected People
        3. The training program will consist of classroom/virtual training and on-the-job training. The duration of the classroom/virtual training will be based on the business requirement.
        4. Infosys operations executive bond You will be on probation for a period of 12 months from the date of completion of the training and your allocation to the Unit.
        5. Candidates are entitled to Earned Leave, right from your date of joining. You will be eligible for 15 working days of earned leave annually during probation. On confirmation as a permanent employee, you will be eligible for 20 working days of leave annually.
          • Leave is credited on a quarterly basis. The leave eligibility shall begin in the quarter of your joining the company, on a pro-rata basis. Leave year is the calendar year and not the fiscal year.
        6. Increments and Promotions: Salary increases are normally given on an annual basis.

        OTHER BENEFITS:

        • Health Insurance Scheme :

          • Standard Plan which provides you and your family (your spouse and two children up to the age of 22 years) with a cover of INR 500,000 per annum.
          • You will be covered under the Group Life Insurance Scheme, managed by Infosys Welfare Trust which provides you with a total Life Insurance cover of INR 6,200,000 of which INR 3,200,000 is covered towards natural death and INR 3,000,000 towards an accidental death.
          • Employees become members of Infosys WelfareTrust, by a one-time payment of INR 250 and a fixed monthly contribution of INR 200

        • Leave: 

          • You will be eligible for 15 working days of Earned Leave annually during your probation and for the first and second years of your service.

        • Working Hours:

          • Your working hours are governed by applicable law. You may be required to work in shifts also
          • Overtime depends upon the business exigencies 
        • Extension of Date of Joining
          • As per the Company policy, an extension in the date of joining will be granted only once based on medical exigencies. The request for an extension must be supported with documentary evidence (medical records and certificates). The request for extension can be sent to offer_extension@infosys.com at least a week before the initial date of joining.

        • Mobility:

          • Transfer: The services can be transferred to any of our units/departments situated anywhere in India or abroad. At such time compensation applicable to a specific location will be payable to you.

        • Notice Period: 

          • Upon your confirmation, this contract of employment is terminable by you by giving 90 days' notice in writing to TCSL.

        • Training Period:

          •  You will be required to undergo classroom and on-the-job training in the first twelve months.

        3. Documents Needed:

        1. Class 10 (or equivalent) marks sheet/s
        2. Class 12 (or equivalent) marks sheet/s
        3. Graduation marks sheet/s
        4. Graduation degree certificate
        5.  Post-graduation marks sheet/s (if applicable)
        6.  Diploma certificate (if applicable)
        7.  Relieving letter/experience letter (in case you are already employed) from all previous employers (as applicable)
        8. Passport / Driving License
        9. National Skills Registry
        10. PAN Card (Under Income Tax laws, disclosure of your Permanent Account Number (PAN) to Infosys Limited is mandatory. Please disclose your PAN to Infosys on or before 30 days from the day of joining and note that disclosure of PAN is a pre-condition for your confirmation into the system).

        5. Salary Details 

        COMPENSATION DETAILS AMOUNT (Rs.)
        1. MONTHLY COMPONENTS
        BASIC SALARY 13,582
        BONUS / EX-GRATIA (95% of the eligible amount (20% of Basic Salary) being paid out on a monthly basis) 2,580
        MONTHLY GROSS SALARY 16,162
        2. ANNUAL COMPONENT
        BONUS / EX-GRATIA - (Balance 5% will be paid out at the end of the financial year after adjusting the advance (95%) paid out on a monthly basis) 136
        3. RETIRAL BENEFITS
        PROVIDENT FUND - 12% of Basic Salary 1,630
        GRATUITY - 4.81% of Basic Salary* 653
        FIXED GROSS SALARY (1+2+3) 18,581
        TOTAL GROSS SALARY 18,581
        OTHER BENEFITS
        Scheme  Amount In INR
        SALARY LOAN (subject to submission of Trainee Agreement) 12000 (12 Months EMI)

        6. Infosys Locations Across INDIA

        • Mysore Head for Training
        • Bangalore
        • Mangalore
        • Hubli 
        • Chennai



        So Folks these are the Vital points that I have Gathered for you for the Infosys Operation Executive Interview Questions & Offer Letter
        If you have any doubts Comment Below


        End of the Page
        Read More