Solving HackerRank HARD Problems with Codestral.
Key Takeaways
The video demonstrates the use of Codestral, a 22B coding expert model, to solve hard Python HackerRank problems, showcasing its capabilities in text completion, fill-in-the-blanks solutions, and code generation, with potential applications in agent-based systems and real-world use cases such as internal SQL code and agent-driven application development.
Full Transcript
I used M's Cod Str to solve hacker ranks hard problems in this video we're going to see how I solved hacker ranks hard problems with Cod still which is an open weight from M company but for a coding specific model and I'm going to show you also what are the things that I don't find the model to be really useful since the model has been launched I've been thinking what are the different ways I can showcase what the model is good at couple of experiments failed couple of experiments worked out and one of the experiments that actually worked out is this hacker rank hard problems so I'm going show you how I managed to solve hacker rank hard problems using mist's chat their own chat it's called lead chat and we're going to use the code St model but I'm also going to point out couple of things that I did not absolutely like about this model I'm not sure if it is fine-tuning issues but let's get into the video first of all I picked the python problem statement within hacker Rank and again if you're not familiar with hacker rank hacker rank is this place where you can go practice programming problems and also a lot of companies for their interviews use hacker rank so probably like the first round screening would be from hacker Rank and if you do not know what is cod codell is a model from ml it's a very popular company they have launched couple of great models codell comes with a non-comercial license even though you can use it for research and personal use so Cod has got the excellent language coverage you have python Java C++ PHP Swift and other languages as well and also so that Cod still can do two different things one it can complete text which means question and answering it can do and also it can give you fill in the blanks fill in the middle so if you have got a code if you have to fill in Middle this can do it for you so that makes an excellent companion for a visual studio code extension so having said that I would like to directly take you to the problem so these are the two problems that I managed to solve using Cod Str so the first one itself is that uh the this is a problem as you can see here given a function of blah blah blah blah blah blah blah blah blah and uh this is a python problem but as you can see here if you take this input it has to come up with that output I'm not going to get specifically into the problem in itself uh I would let you decide if you want to go deep dive into the problem but I'll give you the problem in the YouTube description for you to explore so typically the way hacker rank problems work is that there is a question there is an answer and when you submit the answer your answer is evaluated when you run it your answer is evaluated on one of the test cases but when you submit the code like part of a exam or test or interview it is validated on multiple test cases so you actually have to solve the problem in the right way rather than you know like memorizing and spitting out something for the code to work and that's one of the reason I picked up this platform hacker rank rather than using anything like lead code where it's very easy to to come up with an answer rather here you have to solve all the test cases so to solve this problem I'm going to go to my tool screenshotting tool typically I'm going to copy this entire thing and then convert it to text after I have that I'm going to create a new chat here this is the new chat interface and I'm going to paste the code and then I'm going to say give me a python code to solve this problem and additionally I can say this if you want if you don't want you can it out so it is under a section called iter tools and I can say this is a coding problem with iter tools cool that's it all I'm going to do is send it I'm going to expect a python code in return return so I'm going to get the python code and paste the code here so I have to first select Python 3 paste the code here first run the code just to make sure the code actually works fine and as you can see the sample test case Z it worked fine so I'm going to submit the code now and then see that it has passed most of the test cases out of 16 test cases it uh but it failed a few things so what I'm going to do is I'm going to just literally copy this message come back here paste this and then expect ml or Cod to figure out that there is something wrong and it has to fix the errors copy the code again come back here at this point you might think that I'm being a robot rather than being being a human yes VOA so we have had in two prompts are probably three prompts the first one and then we had like a followup prompt with that we have successfully managed to solve a hard problem on hacker rank for python want to take you through one more example and as you can see here it handled 17 test cases or 16 test cases and I you know as you can see here it doesn't tell you what is a test case so all I told is that it failed the test case and it managed to do it successfully go back again and this is the one that we solved we're going to do one more and in this case we're going to do validating the postal code thing so this is a regular expression problem and let me do the same thing again so I have got the text go to my screenshotting tool select this okay after I select this go back here click a new chat paste the information this is is a python coding problem it's a rejects based one please give me a code that works fine I mean you could have given anything this is yeah and I've got the code already I'm going to copy the code come back here it's Python 3 selected paste it here oh this one I have to fill in cool copy this come back and paste it and copy this come back and paste it make sure that the object name is fine the same yeah the object name is same and pasted first run the code just to make sure that the code is fine and if the code is fine we'll proceed yeah it is fine it says the sample test case Zero is okay fine and I'm going to submit the code and after I submit the code I'm going to look for the test cases we have six test cases Wella in the zero sh we have successfully managed to solve a python problem a regular expression problem a hard problem on one of the most popular coding platforms and we also have managed to solve it with handling seven T seven test cases technically seven test cases why do I have to do this that's the first question now you might think am I going to fake or cheat interviews that's not the intention I mean that's definitely not the intention the reason I'm trying to Showcase this is unlike many other platforms hacker rank test cases are quite good they're robust they evaluate the code on a lot of different parameters different test cases and the fact that code still managed to solve this is super impressive and the fact that it managed to solve it in zero short and also sometimes you know one sh is further more impressive the second thing is these coding abilities can really translate into real world use cases whether it is to create internal SQL code whether it is to create an agent driven application development or whether it's to Simply design your own agent system the programming capabilities of these models could be extremely handy and that is one of the reason I decided to actually go in that route and then say whether Ms Cod St can solve programming problems that are not stack Overflow questions that are not quite common on the internet the thing that I do not like about M's Cod is that I feel that it is quite bad at following instructions in future shs so what do I mean by the future I shouldn't have said future shs future conversations um the first zero short prompt that we give I've always got a really good result the first one but one or two down the line when there are issues when I'm asking it to fix it it does a terrible job and I'm going to show you an example for that so that you think you know I'm being fair to the model showing the model's problems I'm going to go and pick one more problem in this case it's uh it's a matrix it has got an image here but uh you know it has very well explained I'm going to use OCR one again so that it should highly understand the text so I'm going to reduce the size okay and uh just copy the text come back here and OCR is done okay and I'm going to go here click a new chart paste this this is a python problem I would need your help in solving this additionally I'm going to also say that this is a Rejects and paring problem this is a Rejects and paring problem cool so we have given enough information and we already have a starter code we also have a starter code that's it given this and I'm expecting it to solve it and then give it to me so you can see that it has not managed to use this uh but as you can see here it is again taking the input here um and uh we going to take this go back here I'm going to just paste it here I'm going to say run it I have a feeling that I'm making a mistake by doing input again and again but let's see if the mistake is actually a mistake so in this case I previously when I tested it I stumbled upon an error but when I tried to resolve that error with follow-up questions it kind of did not understand either I had to be extremely good with my prompting skills or it kind of did not understand what I was trying to do so there is a new of End of Line reading issue I think this is typically wherever I have got input uh I started getting this issue let me paste this go back here just paste this I should have said where the line is that's my bad okay I should have said this one and uh it gives me the issue it tells me with this information oh that's quite strange uh I don't need this run the code uh let's try to run the code here technically for this particular input it should give this is Matrix hash and you what you might notice is that it takes quite a bit of effort to resolve the issues so the point I'm trying to allude here is that if you have a request you get the right response Cod Str is amazing it has got really good context window because of the long context it has got it manages to understand the problem better it can give you longer code if you give any stter code or documentation it can do a pretty good job but the moment you do not get a good response or fairly decent response in the first attempt then you're going to have a hard time at least like that's what I had maybe it's my Pro it's just my observation I had a hard time convincing it to fix the errors while it was much easier with gp4 so with gp4 turbo gp4 o I had a much fairly easier conversation in getting the code optimized rather than in Mell what I struggled to do with with Cod so this is my only complaint here I don't have a lot of other issues and uh I also Tred to do it with some other languages I'm going to continue my testing with Cod even though this is a model that is commercially not available I believe this is one of the best coding models that are available today and I want to explore this model to see what all things that we can do so probably one day we can build an agent based system with this model but until that this is a good model and um thanks to M for open sharing weight openly sharing the weight not open sourcing it I should be correct about it but anyways yeah see you in another video Happy prompting
Original Description
Codestral is a really good model and i wanted to see if It can solving coding problems efficiently!
I used Mistral's codestral a really powerful (22B coding expert model) with 32K context window to solve hard python hackerrank problems!
🔗 Links 🔗
Codestral - https://mistral.ai/news/codestral/
Codestral on HF mode hub - https://huggingface.co/mistralai/Codestral-22B-v0.1
❤️ If you want to support the channel ❤️
Support here:
Patreon - https://www.patreon.com/1littlecoder/
Ko-Fi - https://ko-fi.com/1littlecoder
🧭 Follow me on 🧭
Twitter - https://twitter.com/1littlecoder
Linkedin - https://www.linkedin.com/in/amrrs/
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from 1littlecoder · 1littlecoder · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
How to create your Free Data Science Blog on Github with Fastpages from Fastai
1littlecoder
Making Interactive Matplotlib Plots for Data Science Visualizations on Jupyter (Python)
1littlecoder
Create your first Data Science Web App using R Shiny
1littlecoder
How to create a Reproducible Example in R using reprex
1littlecoder
No Code Visualization using esquisse with Tableau-like Drag and Drop GUI in R
1littlecoder
Scrape HTML Table using rvest and Process them for insights using tidyverse in R
1littlecoder
Google Teachable Machine Learning Build No Code AI solution
1littlecoder
Create meaningful fake tidy datasets in R using fakir [#rstats Package]
1littlecoder
How to enable using R Programming with Visual Studio VS Code
1littlecoder
Python, Community, Books - with Abhiram R - Bangpypers Co-organizers | 1littlecoder podcast
1littlecoder
Growing a Tech Community across India - Anubha Maneshwar, Founder Girlscript | 1littlecoder Podcast
1littlecoder
Intro to Google Colab - How to use Colab
1littlecoder
Intro to Plotly Express - Complex Interactive Charts with One-Line of Python Code
1littlecoder
Indic NLP Python Toolkit Open Source Development - iNLTK Creator Gaurav Arora | 1littlecoder Podcast
1littlecoder
Do you want a career in Data Science - Tamil Webinar
1littlecoder
Android Smartphone Analysis in R [Live Coding Screencast]
1littlecoder
Programmatically create Images, Memes, Watermarks using Python with imgmaker
1littlecoder
Kaggle Walkthrough to get you started with Data Science - Webinar
1littlecoder
Community, Corporate Job, Coding - Gnana Lakshmi T C aka Gyan, WomenWhoCode Leadership Fellow
1littlecoder
Easy ggplot2 Theme Customization with {ggeasy} | Data Visualization in R
1littlecoder
Excel to R - Pivot + Bar Chart in Excel & R using tidyverse [Live Coding]
1littlecoder
Excel to R #2 - VLOOKUP in Excel to LEFT_JOIN, MERGE in R
1littlecoder
5 websites to get Free Real-World Datasets for Data Science/ML Projects
1littlecoder
Excel to R #3 - APPROXIMATE VLOOKUP in Excel to FUZZY LEFT_JOIN in R
1littlecoder
Correlation-alternative PPS (Predictive Power Score) Python Package Demo
1littlecoder
Automated Website Screenshots in R using {webshot}
1littlecoder
Installing Custom RStudio Theme (Synthwave85)
1littlecoder
Analyse Google Trends Search Data in R using {gtrendsR}
1littlecoder
3 Tips to ask question on Stack Overflow the right way to get answers
1littlecoder
Learn Data Science with R - Mini Projects - Web Scraping Zomato
1littlecoder
Easily make Dumbbell Chart using {ggcharts} | Data Visualization in R
1littlecoder
GET Hackernews Front Page Results using REST API in R
1littlecoder
Quickly deploy ML WebApps from Google Colab using ngrok
1littlecoder
Use Jupyter Notebooks within VSCode (Visual Studio Code) in 2020
1littlecoder
Plotly Interactive Plots as Pandas Plotting Backend df.plot()
1littlecoder
Stack Overflow Developer Survey 2020 Highlights for New Programmers
1littlecoder
Matplotlib Animation Charts in Python using Celluloid
1littlecoder
Coding, Postwoman, Passion Project Book - Liyas Thomas Open Source Developer - 1littlecoder podcast
1littlecoder
Aspiring Data Scientist, Tips on How to learn Business Domain Knowledge
1littlecoder
Bokeh Interactive Charts as Pandas Plotting Backend df.plot_bokeh()
1littlecoder
Easy Fast Python Pandas Summary with Sidetable | Pandas Tips & Tricks
1littlecoder
Inception, Content Ideas, Consistency - Srivatsan Srinivasan AIEngineering YouTube Content Creator
1littlecoder
ggplot2 Text Customization with ggtext | Data Visualization in R
1littlecoder
Penguins Dataset Overview - iris alternative | EDA Data Visualization in R
1littlecoder
YouTube Growth Tips, Content Creation - Bhavesh Bhatt, YouTuber (Data Science & Machine Learning) #7
1littlecoder
Matplotlib Animated Bar Chart Race in Python | Data Visualization
1littlecoder
Simple Python GUI Development using {guietta}
1littlecoder
#8 Niche, Growth, Monetization - David Langer - YouTuber Dave on Data
1littlecoder
Simple Fast 3-step Python OCR using Deep Learning 40+ Languages
1littlecoder
Github New Feature Profile Summary/Mini-Resume - Profile Views
1littlecoder
Otto ML Assistant, GPT-3 on Philosophers, Nvidia-ARM - 3 ML Tech News
1littlecoder
What is OpenAI GPT-3 - Hype, Examples, Worries
1littlecoder
Julia 1.5, Datamuse API, Live HDR+ Pixel 4a - Machine Learning Tech News
1littlecoder
Self-driving Car Engineer sentenced, arXiv Dataset, AI/ML Startup Idea - Machine Learning Tech News
1littlecoder
GPT-3 Explorer, Ciphey (Automated Decryption), Py-Sudoku - ML Tech News
1littlecoder
How to use Advanced Google Search to extract Email Ids from Linkedin
1littlecoder
Cartoonizer Toon-IT (AI Web App), GPT-3 Advice, Android Earthquake Detection - ML Tech News
1littlecoder
Flow - R Package to visualize code logic, functions as a Flow Diagram
1littlecoder
Build GPT-3-like Language Model on Google Colab with minGPT [PyTorch]
1littlecoder
Create a Pencil Sketch Portrait with Python OpenCV
1littlecoder
More on: LLM Foundations
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
5 prompt engineering techniques to get the best out of a legacy project
Dev.to · Marco Coelho
The Real Reason Prompt Engineering Isn't Going Away
Dev.to AI
Common Prompt Engineering Mistakes and How to Avoid Them
Medium · ChatGPT
Day 5: Prompt Engineering Basics (For DevOps & Cloud Engineers)
Medium · AI
🎓
Tutor Explanation
DeepCamp AI