SlideShare une entreprise Scribd logo
1  sur  13
Most common
errors encountered
in programming
By Lakshmi
Sarvani V
Emp id 4472
Department of
Basic Engineering Sciences - I
Wrong
Answer
Wrong answer occurs not only
when your logic is wrong but
also due to wrong choice of
datatype.
Let us understand this with an
example
August Long Challenge: Smallest KMP
Wrong Answer
Correct Answer
Example
Question:
Find the
Pattern
The pattern challenge is back again with more complexity. Can you
solve it??
Input 1:
3
2224 5262 223
Output 1:
5485
Input 2:
11
170 368 472 298 22 139 370 1061 162 1073 491
Output 2:
1095
Wrong
Answer
Correct Code
Run Time
Error
(SIGSEGV)
This is an error caused by an invalid memory
reference or segmentation fault. The most
common causes are accessing an array
element out of bounds or using too much
memory.
When the memory assigned is not enough to
store the input then also we get segmentation
fault
Let us understand this with an example
Greatest String
You are given a string S and an integer Q. You are
allowed to perform at most Q operations on the
string. In one operation, you can change
any vowel to it's next character
(e.g., 'a'->'b', 'e'->'f', 'i'->'j', 'o'->'p', 'u'->'v').
Length of the string
can be up to 100000
Error: Time Limit
and Segmentation
fault
Violating the constraint that
Length of the string can be up
to 100000 leads to
segmentation fault.
In finte loop without break
leads to Time limit exceeded
error
Another Example for Segmentation
fault and wrong answer
Question:
Shreya and Non-
Palindrome (Hacker
Earth)
Correct
Code

Contenu connexe

Similaire à Errors incompetitiveprogramming

11614, 1021 AMTake Test 5451 Q3Page 1 of 7httpsnccu.docx
11614, 1021 AMTake Test 5451 Q3Page 1 of 7httpsnccu.docx11614, 1021 AMTake Test 5451 Q3Page 1 of 7httpsnccu.docx
11614, 1021 AMTake Test 5451 Q3Page 1 of 7httpsnccu.docxhyacinthshackley2629
 
Kostiantyn Omelianchuk, Oleksandr Skurzhanskyi "Building a state-of-the-art a...
Kostiantyn Omelianchuk, Oleksandr Skurzhanskyi "Building a state-of-the-art a...Kostiantyn Omelianchuk, Oleksandr Skurzhanskyi "Building a state-of-the-art a...
Kostiantyn Omelianchuk, Oleksandr Skurzhanskyi "Building a state-of-the-art a...Fwdays
 
Faculty of ScienceDepartment of ComputingFinal Examinati.docx
Faculty of ScienceDepartment of ComputingFinal Examinati.docxFaculty of ScienceDepartment of ComputingFinal Examinati.docx
Faculty of ScienceDepartment of ComputingFinal Examinati.docxmydrynan
 
Mca winter 2013 2nd sem
Mca winter 2013 2nd semMca winter 2013 2nd sem
Mca winter 2013 2nd semsmumbahelp
 
feras_kalita_mcgrory_2015
feras_kalita_mcgrory_2015feras_kalita_mcgrory_2015
feras_kalita_mcgrory_2015Conor McGrory
 
Midterm Exam Solutions Fall03
Midterm Exam Solutions Fall03Midterm Exam Solutions Fall03
Midterm Exam Solutions Fall03Radu_Negulescu
 
Fm G As
Fm G AsFm G As
Fm G Asysemet
 
Improving Code Quality Through Effective Review Process
Improving Code Quality Through Effective  Review ProcessImproving Code Quality Through Effective  Review Process
Improving Code Quality Through Effective Review ProcessDr. Syed Hassan Amin
 
Determining Basis Test Paths Using Genetic Algorithm and J48
Determining Basis Test Paths Using Genetic Algorithm and J48 Determining Basis Test Paths Using Genetic Algorithm and J48
Determining Basis Test Paths Using Genetic Algorithm and J48 IJECEIAES
 
Day 2 build up your own neural network
Day 2  build up your own neural networkDay 2  build up your own neural network
Day 2 build up your own neural networkHuyPhmNht2
 
Your Own Metric System
Your Own Metric SystemYour Own Metric System
Your Own Metric SystemErin Dees
 
Knowledge Engineering
Knowledge EngineeringKnowledge Engineering
Knowledge EngineeringMegha Sharma
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
11.CS2005-ExamBrief-2021.22(2).pptx
11.CS2005-ExamBrief-2021.22(2).pptx11.CS2005-ExamBrief-2021.22(2).pptx
11.CS2005-ExamBrief-2021.22(2).pptxPocketRocketDC
 

Similaire à Errors incompetitiveprogramming (19)

midterm_fa08.pdf
midterm_fa08.pdfmidterm_fa08.pdf
midterm_fa08.pdf
 
midterm_fa07.pdf
midterm_fa07.pdfmidterm_fa07.pdf
midterm_fa07.pdf
 
11614, 1021 AMTake Test 5451 Q3Page 1 of 7httpsnccu.docx
11614, 1021 AMTake Test 5451 Q3Page 1 of 7httpsnccu.docx11614, 1021 AMTake Test 5451 Q3Page 1 of 7httpsnccu.docx
11614, 1021 AMTake Test 5451 Q3Page 1 of 7httpsnccu.docx
 
Symbolic Execution And KLEE
Symbolic Execution And KLEESymbolic Execution And KLEE
Symbolic Execution And KLEE
 
Kostiantyn Omelianchuk, Oleksandr Skurzhanskyi "Building a state-of-the-art a...
Kostiantyn Omelianchuk, Oleksandr Skurzhanskyi "Building a state-of-the-art a...Kostiantyn Omelianchuk, Oleksandr Skurzhanskyi "Building a state-of-the-art a...
Kostiantyn Omelianchuk, Oleksandr Skurzhanskyi "Building a state-of-the-art a...
 
Faculty of ScienceDepartment of ComputingFinal Examinati.docx
Faculty of ScienceDepartment of ComputingFinal Examinati.docxFaculty of ScienceDepartment of ComputingFinal Examinati.docx
Faculty of ScienceDepartment of ComputingFinal Examinati.docx
 
Mca winter 2013 2nd sem
Mca winter 2013 2nd semMca winter 2013 2nd sem
Mca winter 2013 2nd sem
 
Capstone mid semester presentation
Capstone mid semester presentationCapstone mid semester presentation
Capstone mid semester presentation
 
feras_kalita_mcgrory_2015
feras_kalita_mcgrory_2015feras_kalita_mcgrory_2015
feras_kalita_mcgrory_2015
 
Midterm Exam Solutions Fall03
Midterm Exam Solutions Fall03Midterm Exam Solutions Fall03
Midterm Exam Solutions Fall03
 
Fm G As
Fm G AsFm G As
Fm G As
 
Improving Code Quality Through Effective Review Process
Improving Code Quality Through Effective  Review ProcessImproving Code Quality Through Effective  Review Process
Improving Code Quality Through Effective Review Process
 
Determining Basis Test Paths Using Genetic Algorithm and J48
Determining Basis Test Paths Using Genetic Algorithm and J48 Determining Basis Test Paths Using Genetic Algorithm and J48
Determining Basis Test Paths Using Genetic Algorithm and J48
 
Day 2 build up your own neural network
Day 2  build up your own neural networkDay 2  build up your own neural network
Day 2 build up your own neural network
 
Your Own Metric System
Your Own Metric SystemYour Own Metric System
Your Own Metric System
 
Knowledge Engineering
Knowledge EngineeringKnowledge Engineering
Knowledge Engineering
 
TDD_demo.ppt
TDD_demo.pptTDD_demo.ppt
TDD_demo.ppt
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
 
11.CS2005-ExamBrief-2021.22(2).pptx
11.CS2005-ExamBrief-2021.22(2).pptx11.CS2005-ExamBrief-2021.22(2).pptx
11.CS2005-ExamBrief-2021.22(2).pptx
 

Plus de Lakshmi Sarvani Videla (20)

Data Science Using Python
Data Science Using PythonData Science Using Python
Data Science Using Python
 
Programs on multithreading
Programs on multithreadingPrograms on multithreading
Programs on multithreading
 
Menu Driven programs in Java
Menu Driven programs in JavaMenu Driven programs in Java
Menu Driven programs in Java
 
Recursion in C
Recursion in CRecursion in C
Recursion in C
 
Simple questions on structures concept
Simple questions on structures conceptSimple questions on structures concept
Simple questions on structures concept
 
Relational Operators in C
Relational Operators in CRelational Operators in C
Relational Operators in C
 
Recursive functions in C
Recursive functions in CRecursive functions in C
Recursive functions in C
 
Function Pointer in C
Function Pointer in CFunction Pointer in C
Function Pointer in C
 
Functions
FunctionsFunctions
Functions
 
Java sessionnotes
Java sessionnotesJava sessionnotes
Java sessionnotes
 
Singlelinked list
Singlelinked listSinglelinked list
Singlelinked list
 
Graphs
GraphsGraphs
Graphs
 
B trees
B treesB trees
B trees
 
Functions in python3
Functions in python3Functions in python3
Functions in python3
 
Dictionary
DictionaryDictionary
Dictionary
 
Sets
SetsSets
Sets
 
Lists
ListsLists
Lists
 
DataStructures notes
DataStructures notesDataStructures notes
DataStructures notes
 
Solutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structuresSolutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structures
 
C programs
C programsC programs
C programs
 

Dernier

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Dernier (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

Errors incompetitiveprogramming

  • 1. Most common errors encountered in programming By Lakshmi Sarvani V Emp id 4472 Department of Basic Engineering Sciences - I
  • 2. Wrong Answer Wrong answer occurs not only when your logic is wrong but also due to wrong choice of datatype. Let us understand this with an example
  • 3. August Long Challenge: Smallest KMP
  • 6. Example Question: Find the Pattern The pattern challenge is back again with more complexity. Can you solve it?? Input 1: 3 2224 5262 223 Output 1: 5485 Input 2: 11 170 368 472 298 22 139 370 1061 162 1073 491 Output 2: 1095
  • 9. Run Time Error (SIGSEGV) This is an error caused by an invalid memory reference or segmentation fault. The most common causes are accessing an array element out of bounds or using too much memory. When the memory assigned is not enough to store the input then also we get segmentation fault Let us understand this with an example
  • 10. Greatest String You are given a string S and an integer Q. You are allowed to perform at most Q operations on the string. In one operation, you can change any vowel to it's next character (e.g., 'a'->'b', 'e'->'f', 'i'->'j', 'o'->'p', 'u'->'v'). Length of the string can be up to 100000
  • 11. Error: Time Limit and Segmentation fault Violating the constraint that Length of the string can be up to 100000 leads to segmentation fault. In finte loop without break leads to Time limit exceeded error
  • 12. Another Example for Segmentation fault and wrong answer Question: Shreya and Non- Palindrome (Hacker Earth)