Friday, May 13, 2022

 # ========================================================================

# leaf frog coding interview question
# =========================================================================

def logic(inputs, inputs_length):
maximum = int(max(inputs))
missinig = []
for i in range(maximum):
if i not in inputs:
missinig.append(i)
return missinig

input_length = int(input())
inputs = []
for x in range(input_length):
inputs.append(int(input()))

print(logic(inputs, input_length))


==========================================================================
def logic(my_input):
result = []
res = ""
words = my_input.split(" ")
for word in words:
firstchar = word[0]
newword = word[1:] + firstchar + "arg"
result.append(newword)
for i in result:
res = res + i + ""

return res

my_input = input()

print(logic(my_input))


==========================================================================

def logic(my_input):
result = ""
vowels = ["a", "e", "i", "o", "u"]
string = my_input.casefold()
count = {}.fromkeys(vowels, 0)
for character in string:
if character in count:
count[character] += 1
for keys in count:
value = count[keys]
if value != 0:
result = result + str(value) + keys
return result

my_input = input()

print(logic(my_input))




# ========================================================================
# end leaf frog coding interview question
#=========================================================================

Tuesday, July 14, 2020

NINA + SING = AGAIN ? assign each alphabet with a number such that addition becomes true?

NINA + SING = AGAIN ? assign each alphabet with a number such that addition becomes true?



    NINA
 + SING 
=========
 AGAIN


now, A should be 1 or 0

  let A = 1

     NIN1
 +  SING
========
   1G1IN



I should be 5 or I = 0

when I = 5

 N5N1
 S5NG
=======
1G15N


N + N =  5 or 15 not possible

thus, when I = 0


       N0N1
  +   S0NG
=========
     1G10N




N should be 5


      5051
  + S05G
==========
   1G105



G should be 4

     5051
 +  S054
=========
   14105




thus S should be 9

     5051
 +  9054
===========
   14105



Hence

NINA = 5051
SING = 9054
AGAIN = 14105



Hence


A = 1
I = 0
G = 4
N = 5
S = 9


















History of Artificial Intelligence?

History of Artificial Intelligence.

· 1950: Arthur Samuel developed a checkers-playing computer program.

· 1955: The first artificial intelligence computer program.

· 1958: developed Lisp, the most popular programming language for AI.

· 1959: “machine learning ” tern coined.

· 1964: an early ai program written in Lisp that solved algebraic word problems.

· 1965: ELIZA, an interactive chat-based computer program.

· 1995: ALICE was developed

· 1997: a chess-playing computer defeated Gary Kasparov

· 1999: Sony introduces AIBO.

· 2006: “machine reading” coined as an unsupervised autonomous understanding of the text.

· 2011: Apple released Siri, a virtual assistant on IOS.

· 2014: Microsoft released Cortona, Amazon Alexa

· 2016: Humanoid robot called Sophia is created.

· 2017: Facebook AI research lab trains two chatbots to talk among themselves.

· 2018: Samsung introduced Bixby






Importance of Artificial Intelligence?

Importance of Artificial Intelligence.

1. The smart device made with artificial intelligence can be available 24/7 hour.

2. Artificial intelligence can be used in digital assistance.

3. It handles the repetitive job better than a human can.

4. Artificial intelligence reduces errors.

5. Can be used to detect pattern better than human.

6. Used in sentiment analysis of the given text. It says either the given text is positive or negative

7. help in classification of data







List the AI applications every day you see?

List the AI applications every day you see. 

          

  •                  Google AI-powered Predictions        Ridesharing apps like Uber and Lyft

  •          Commercial Flights Use an AI Autopilot
  •          Email-spam filters
  •         Smart email categorization
  •         Mobile check deposits
  •         Fraud Prevention
  •        Social networking, Facebook, Pinterest, Instagram, Snapchat,
  •         Online shopping, search, recommendations, Fraud Protection, Netflix,                 youtube
  •        Mobile use, voice to text, smart personal assistance
  •       Opening your phone with face id.


Explain the possible AI applications in the following fields:

Possible application of AI?


  • Agriculture:

It is mainly classified into three major categories:

1.      Agriculture Robots – Companies are developing and programming robots to handle essential agricultural tasks such as harvesting crops at a higher volume and faster pace than human laborers.

 

2.      Crop and Soil Monitoring –Companies are leveraging computer vision and deep-learning algorithms to process data captured by drones and/or software-based technology to monitor crop and soil health.

 

 

3.      Predictive Analytics – Machine learning models are being developed to track and predict various environmental impacts on crop yield such as weather changes.

  

  • Tourism

The chatbot can be used as a guide for tourists. Chatbots are ideal for customer-centric businesses. The chatbot can serve 24/7 frontend customer care techniques. Many question responses can be automated using chatbots. Some flights are using mobile applications and chatbots for updating their clients on the flight. It also answers questions like what is the fun thing to do in London this weekend. Many brands are using AI for customer services. Recommendation system for recommending the user about the places around. AI can be used in weather prediction.




  • Herbal Industry Automation

AI helps to mine traditional medicine data. In short, AI helps to digitalize ancient medicine books and clinical data. AI robots can be used to develop medicine in a large scale.

 

 

 

  • Stock Market

Ai can be used in time forecasting of the stoke market. It can be used to interpret many stoke price data.

 

  • Machine Translation

Ai is used in machine translation, it understands the one language and using different AI algorithms AI the model can generate the same phrase into another language.



  • Face Detection

There are many algorithms that can detect the face of living being using AI approaches.

Some are Feature-based, appearance-based, knowledge-based, template matching.

 

  • Product Recommendation

Based on the various parameter AI model can predict which item is best fit for which customer at which time. The recommendation system predicts the product about which a person is interested in.

 


  • Image/Video Guided Surgery

This kind of surgery uses different visualization tools to visualize the internal structure of the human body parts. The automated overlay of the three-dimension reconstructions of internal anatomy on top of live video views of the patient.

 


  • Speech Recognition

Speech recognition is a technology that can recognize spoken words, which can then be converted to text. This involves various AI algorithms to understand Speech.

 

  • Universe Exploration

AI algorithms may result in the conclusion that helps to explore the universe more effectively than human manual tasks. Recently, NASA and Google in making the discovery of two obscure planets. One is a minuscule sized planet in Kepler-90, now called Kepler-90i which is the super earth-sized rocky planet.