Auto Added by WPeMatico

Kotlin Heroes: Episode 6 Is Here

Registration for Kotlin Heroes: Episode 6 is open. This coding challenge is co-hosted by JetBrains and Codeforces, the most popular platform for programming contests. It is a great opportunity to learn about the features and capabilities of the Kotlin language.
Register now and save the date: March 9, 2:35 PM UTC.


“Programming contests are a great way to test your programming skills and improve them. Whether you are a seasoned competitive programmer or a Kotlin developer who has never participated in a programming contest before, you’ll find these contests useful, entertaining, and thought-provoking. They’re designed to give everyone a chance to win prizes. We hope that you’ll find the Kotlin language fun and enjoyable to use and that you will keep using it in other programming contests.”
— Roman Elizarov, ICPC Live Director, Project Lead for Kotlin


The contest features a set of problems designed for both beginners and seasoned competitive programmers. Competitive programming is a mind sport where contestants write programs to solve precisely formulated algorithmic problems within strict constraints. The problems range from simple ones, which can be solved by any developer and don’t require much code, to complex ones that demand knowledge of specific algorithms and data structures, and lots of experience.

The top three winners will receive prizes of $512, $256, and $128, respectively. The top 50 contestants will win a Kotlin Heroes t-shirt and exclusive Kotlin stickers. Every competitor who solves at least one problem will enter a drawing for one of the 50 exclusive Kotlin Heroes t-shirts.

Before the Kotlin Heroes: Episode 6 begins, you are invited to test your programming skills in a practice round. On March 9, you are invited to take the real challenge and compete for prizes.

Check out our page about Kotlin Heroes to learn more about the format of the competition, and resources available for preparation.

To get ready for the challenge, you can read our tutorial on competitive programming in Kotlin and watch the videos from our Competitive Programming playlist on YouTube.

See you soon!

Continue ReadingKotlin Heroes: Episode 6 Is Here

Kotlin Heroes 5: ICPC Round is Approaching

Welcome to Kotlin Heroes 5: ICPC Round, the new round of our regular competitive programming contest co-hosted by JetBrains and Codeforces! Register now and save the date – November 12, 2020.

This is a special round for which we’ve joined forces with the world-famous ICPC, the International Collegiate Programming Contest. It’s a rare chance to test your skills and see how you compare to some of the brightest coding minds.

Kotlin Heroes is fun for everyone regardless of their level of programming experience, and every participant has an equal chance of winning a prize!

What is Kotlin Heroes

Kotlin Heroes is a Kotlin-only coding contest created and hosted by JetBrains and Codeforces, the most popular platform for coding competitions. The previous four rounds attracted more than 4000 participants, including tourist, Egor, Benq, eatmore, Golovanov399, Petr, ecnerwala, and other famous competitive programming champions.

This is a great opportunity to learn about Kotlin’s capabilities, as well as a chance to practice coding and adopt a powerful modern programming language.

I like a challenge, sign me up!

Rules

Participants have 2 hours and 30 minutes to solve as many problems as they can. Each problem set includes tasks of varying difficulty to suit everyone from beginners to the most advanced programmers. Participants are faced with up to 10 problems of increasing complexity and ranked according to the number of correct solutions they come up with.

Prizes

  • The top three winners will be awarded with $512, $256, and $128.
  • The top 50 contestants win Kotlin Heroes t-shirts and stickers.
  • Everyone who gets through the first task will be entered into a raffle to win one of 50 Kotlin Heroes t-shirts.
  • To mark this special round, we’ll be issuing participation certificates from the Kotlin team, JetBrains, Codeforces, and ICPC to everyone who takes part.
  • There is also an outstanding special recognition prize from the ICPC: ICPC- experience, an invitation to the Moscow World Finals 2021, all-inclusive on-site (hotel, meals, ceremonies, and swag, are included; visa, flights, transportation to the contest location is not).

Join Kotlin Heroes!

Who can attend

Kotlin Heroes welcomes everyone. The contest has no limitations on experience or professional background.

How to prepare

We hope to see you at Kotlin Heroes 5: ICPC Round on November 12!

Continue ReadingKotlin Heroes 5: ICPC Round is Approaching

JetBrains 8th Annual Hackathon: Home Edition

It is that time of year again! 48 hours of limitless freedom to play, create, and test out ideas that may go nowhere – or that might just change the world. Following the spirit of Hackathons, this year, we adapted and evolved, and borne our first JetBrains Hackathon: Home Edition, something it turns out that not many of our community members have tried.

Home of Innovation

Our Hackathons bring together people that may not have otherwise cooperated before. Working in 10 cities across 7 countries with time zones as much as 5 hours’ difference, 48 teams made up of 155 participants set out to bring their projects to life.

The teams thrived creating brand new technologies and tools while finding ways to coordinate and collaborate remotely using 450 hours of online video communication alone. They seized this chance to break the routine, test their limits, think outside the realms of normal, and see what was possible. Some teams used it as an opportunity to dive deeper into new tools like JetBrains Space and test the possibilities of the API and the extensibility it provides. Other teams ran with ideas to challenge the status quo and create change and improve the way existing things work. The end result was 40 projects that brought about completely new innovations. Achieving this from their homes is a feat in itself, but it seems that some teams may have benefited from a little help from their furry friends.



The categories projects could win this year were broad, offering an opportunity for everyone to pick up an award.

The categories this year:

New Tech Stack
Returning again this year is the New Tech Stack category. This is the category for exciting new technologies to come to life. This year there were 5 finalists chosen from the projects submitted. Each bringing something new to the tech stack. Little Space provides a small macOS menu bar widget for Space that helps you organize your day through super short interactions, avoiding context switching as much as possible. KotNET a .NET backend for Kotlin to make Kotlin an even more universal language. PyCharm Edu Online which gives out powerful Edu tools extra accessibility by giving them a home online. Compose for Web which aimed at porting the Jetpack Compose to the web. And Space [project] bringing the powerful features of Space and integrating them with new technologies.

Tooling
There were 7 finalists in the tooling category with a wide range of very diverse projects.
Color Scheme Designer sought to make customizing the IDE simpler whereas Hook.ws aimed to solve the real-time communication problem between online applications and desktop applications. There was Instant Find Usages that builds an in-memory reference database for a whole project to speed up later Find Usages requests in the IDE. IntelliShot an Intelligent screenshotting tool that recognizes points of interest on an image and suggests zones to cut. The project Secure Password Sharing provides an easy to use, secure way to send a password to a friend/colleague. Page Object Strikes Back a simple yet powerful Selenium Page Object generator for QA Automation engineers as a built-in IDE tool. Spielberg a tool that gives tips to make sure YouTube videos have their best chance at success. And finally, the project Visual Programming IDE a tool for contest programming investigating the ways people do programming through an automatic log, then using this information try to find exactly what the developer needs during coding and show it.

Home Office
Our new category for this year. Finalists took the current challenges of this new way of working head-on, helping people to stay home and stay productive.
Awesome Meeting Facilitator made it easy to set up a quick meeting over chats. Kuzya helped set up recurring tasks and create checklists and reminders for home activities. Simple, fast, and useful. Mind the Space used the extensibility of the Space API to provide new unique options to enhance the JetBrains Space platform even further. PyCharm Edu Online brought new accessibility to the potential programming learners by providing the possibility to learn to code over the web. Stay-at-Home Honey to manage life and work balance by uniting work and family calendars in Space, which can be shared with teammates but preserve privacy. And Virtual Conference Booth where people can get the same interactive conference experience from the comfort of their own home.

Tangible
Back again this year is the category Tangible. Where projects come to life through hardware. This year’s projects didn’t reinvent the wheel, they made it. KeyGen was a portable raspberry pi based unit that can encrypt keys offline that can be used for updated security with 2-factor authentication. Mom ON AIR a system to help signal to the family when an important meeting was taking place that should not be interrupted by please for juice/food/play. SunKeeper that collects the energy from the sun so you can harness it later to charge your laptop. And Tesla Station that reimagines the next generation of speakers, with fire included.

Entertainment
Many of the projects this year were dedicated to entertainment or socializing, something that we have all missed a bit the last few months. The projects in this category include an online version of Cards Against Humanity for our colleagues to play with each other. JetRun makes the experience of physical activity from home fun, by motivating users with some healthy competition on an internal company leaderboard that takes data from people’s fitness devices. æmo the record-breaking project which had 18 people bringing it to life. It takes the sources of information you are getting overloaded with and provides a short summary of each using the TextRank algorithm in a single feed which is grouped by topics. Publo which provides a fun augmented layer to put a face over your face. Tesla Station to crank up the music at parties with a new speaker technology. And Virtual Conference Booth where all the joy of interacting at conferences has been included, making virtual conferences a more fun reality.

Taking into account our current circumstances and encouraging more communication continues two new special categories were announced this year for special project winners:
Most Socially Active Team
Best Photo / Video Report

New Tech Stack (2 winners)

Hackathons are an excellent opportunity to test out new technology and experiment with the possibilities of what can be done and what new technologies are out there waiting for us to explore. This category had two teams that were equally as deserving of winning.

PyCharm Edu Online
Dmitry Trofimov, Stepan Tarasevich, Alexander Gusakov, Aleksandr Borisenko, Ruslan Golov, Stanislav Utikeev, Artyom Prikhodko

PyCharm Edu is a special free edition of the popular Python IDE, PyCharm. It is designed to help people learning Python and has bundled courses that are guided and hands-on with the code.

This project brought about the creation of PyCharm Edu Online, an in-browser implementation of PyCharm Edu. This makes the tool more accessible and easier to start off with, as it has all the cool features of PyCharm Edu but without having to install anything, and all within the browser. It is already available online at https://pycharm-edu.datalore.io/, it provides the same courses for interactively learning the Python programming language and includes useful features from the IDE, such as code completion, to help users code.

Space [For Project]
Aleksandr Slapoguzov, Anton Sokolov, Artemy Pestretsov, Grigorii Kargin

The Hackathon offers teams a break from their day to day responsibilities and gives them a chance to put all their effort into something different, like working on some of our newest upcoming super-cool products and tools. So when we say Space integration for a super-secret ongoing project, we’ve already said too much. But anyway, you should know it now supports some of the features from JetBrains Space.

Tooling (3 winners)

Improving our tools for our users is an ongoing process that we take seriously and try to prioritize the changes that will have the biggest impact quickest. The hackathon is a great opportunity for teams of like-minded people to dedicate some time to looking at tools they have all had the burning desire to see come to life, but may not otherwise have the time, people, or skill on their own to make it possible.

Color Scheme Designer
Nikolaj Schumacher, Florian Kistner

Color schemes for working with code are very personal, and getting them just right is important to many people. But a carefully crafted color scheme is difficult to tweak when there are so many options. It would potentially be possible to do this fully in code, but it isn’t easy without previewing the changes. This project makes it a little easier to get your color scheme just right for your JetBrains IDE.

Page Object Strikes Back
Yuriy Artamonov, Eugene Nizienko

A simple yet powerful Selenium Page Object generator for QA Automation engineers as a built-in IDE tool.

Before this hackathon, there was no built-in solution for Selenium selectors generation and users had to use a third party Page Object generator from a web browser. There are lots of code insight features for Selenium, but writing the classes themselves could sometimes be 80% of the work. You’d have to go to a web browser, find an element, copy it, and then switch between the browser and the IDE as you insert your selectors, and maybe, just maybe, you’d get a result and be able to write a test. Now with this Selenium Testing Plugin, available in the latest IntelliJ IDEA 2020.2 nightly build, you can do it all within the IDE.

Spielberg
Roman Prokashev, Andrey Zavodov, Ilia Shulgin, Mariia Shemetova

Who better to help us get our YouTube videos to number 1 than Steven Spielberg, the legendary and all-time highest-grossing film director?

YouTube, the video-sharing platform, is considered to be the 2nd largest search engine in the world. We have a lot of existing videos and are regularly uploading new video content. But, sometimes, our videos don’t receive as many views as we might like. How can we improve this? We look to Spielberg.

This project created a tool for optimizing JetBrains YouTube videos so it’s easier for users (and the YouTube search engine) to find our content.

The tool analyzes a user’s video, taking into account YouTube ranking factors like video description, title, tags, hashtags, thumbnail, video duration, publication date and time, captions, etc. and metrics from YouTube Analytics. It then gives the user suggestions on how they could improve these aspects of the video for maximum findability.

Home Office (2 winners)

Work from home has become even more of a norm this year. As a result, teams have had first-hand insight into this way of working and ideas on how to improve their situation. What better time to explore the solutions than from the Hackathon Home Edition. These projects have overcome some of the fundamental challenges we have been faced with from this change to exclusively working from home by adding home comforts to remote home office work.

Awesome Google Meet Facilitator
Olga Narochnaya, Alexey Kireev, Stas Shemyakin, Dmitry Gizatov,
Tina Prokhorova, Dmitrii Bogdanov

This project set out to improve meeting remotely by providing a bunch of helpful tools for Google Meet:

✅ Create a meeting instantly from your chats in JetBrains Space or Slack and share the link without extra actions.
✅ Send reactions directly to your colleague right from the Google Meet UI.
✅ Have a private chat with your colleague while participating in a meeting.
✅ Common chat in Google Meet is safe now – the history is sent to you after the meeting is over.

Mind the Space
Sergey Kesarev, Anastasia Miller, Alexander Prendota, Lidiya Chernigovskaya, Semyon Atamas, Mikhail Vink, Dmitry Jemerov

This project set out to specifically raise awareness of mental health and work-life balance by adding some more options to the smart features already implemented in JetBrains Space to address the challenges that come with fast-paced collaboration.

The project added more options for:

  • Notifications: delayed messages, silent messages, time-based muted notifications, bulk notifications (aka notification digest), slow mode (limit on messages from a single person), and automatically disabling notifications for some time from channels with a lot of activity (switching it to notifications digest).
  • Raising awareness: advice about meetings (duration, blocking time to focus on work), notification if a user tries to send multiple messages in a row rather than a single message, daily mental checkup, and mental health tips.

Tangible

Projects during the hackathon can produce some tangible hardware and have immediate business value. The tangible category was created to reward such projects.

KeyGen
Andrey Sizov, Sergey Ugdyzhekov, Mikhail Filippov, Andrei Efimov

JetBrains has always been a distributed company with multiple offices and remote employees. It is really challenging to implement secure IT infrastructure to give access to our business-critical resources, especially now we are almost all working remotely.

Keeping it simple is key – Yubikey. This team’s mission was to the world better and enforce our own security. Yubikey provides a second authentication factor on JetBrains Hub, GitHub, Google, 1Password, and so on. It authorizes via SSH and RDP, can be used to access resources that require a personal SSL Certificate, sign commits in Git, and encrypt and decrypt files and text. The team created a Yubikey encryption installer out of a raspberry pi, so keys can be created without the risk of exposing the keys to the internet.

Entertainment

Hackathons are also supposed to be a lot of fun, so of course, there needs to be a category for entertaining projects that bring people together.

Cards Against Humanity*
Scott Adams, Ernst Haagsman, Mikhail Kraynov, Maxim Mazin, Tatiana Tulupenko

*’Cards Against Humanity’ is a registered trademark owned by ” Cards Against Humanity, LLC’. Aspects of the game are derivative works of ‘Cards Against Humanity’, which is licensed under CC BY-ND 2.0. by Cards Against Humanity LLC.

This team got together to create a web application for internal use to play Cards Against Humanity against other players from JetBrains. Now even being apart from friends doesn’t mean you can’t still play games with each other and have fun. With Urban Dictionary integration to help players understand the full context of the awful things their cards are saying, so the full hilarity of the game can be understood by all. This game was complete with integrated video functions to see people’s reactions, keep score, and manage the game.

Special Awards

Hackathons are social affairs across the whole company. This year there was special recognition for the team that really went out of their way to be socially active. The Most Socially Active Team award went to the project Mind the Space.

From start to finish, some teams really kept everyone in high spirits, posting regular updates on the progress of their projects. Some projects really stood out as clear examples, making regular updates on social media about their progress throughout the hackathon, and so to recognize this extra effort a special award for Best Photo / Video Report was given to the project Sun Keeper and Tesla Station both by Ivan Kuleshov.

Trophy Winner

Forever etched in the coveted JetBrains Hackathon Trophy Cup, this is the most prestigious award a team can aspire to achieve. Only one team can take home this honor, and this year it was rightly presented to…

Virtual Conference Booth
Alexander Rassokhin, Anna Simonova, Valeria Letusheva, Liza Kulikova

The events of 2020 have meant that all conferences have had to adapt and have begun to move online. Analyzing the different aspects of what different people look to get from conferences, the team started to devise a solution that would work for everyone.

What could they create to help?
— Sponsors: how to reach goals in marketing, HR, community support?
— Attendees: how to have fun, get swag, make new connections?
— Organizers: how to make it a good investment of time and money for everybody?

What they created was a virtual conference booth experience where people can explore and interact with the team…

Actively Used Award

It is not just the projects from this year that have the chance to win prizes. The projects created often go on to carry on providing value. The projects that are we can’t now imagine working without can win the Actively Used Award category.

Static Websites in Space
Sergey Ugdyzhekov, Sergei Ilin, Alexander Prendota, Evgenii Titkov, Andrey Sizov, Dmitry Loktev, Andrey Efimov

JetBrains Space is our newest product. In last year’s hackathon, this team rose to the challenge to create a feature for the platform that they could see great value in – Static websites for the projects in Space. With this plugin, you can deploy websites for any of your projects without being limited to any particular engine. This has been used extensively in the product since, and the value from this hackathon project goes on. And so, it has earned itself the award for being the most actively used.

The Hackathon in Numbers

  1. 1st Home Edition
  2. 5 minutes to present
  3. 5 hours a day on average of sleep
  4. 7 countries
  5. 7 categories
  6. 10 cities
  7. 13 prizes
  8. 16 person sized hackathon team
  9. 40 projects finished
  10. 48 projects started
  11. 48 hours to complete
  12. 54 project ideas
  13. 155 participants
  14. 247 voters
  15. 450 hours of online video communication
  16. 3,000 commits
  17. 22,000 dollars in prizes

Technologies used

After Effects, Android, AWS, Batch, Beam VM, BitTorrent, Bourne, C#, C++, Chrome extensions, CIL, Clikt, CSS, Detekt, Discord, Django, Docker, DOS, Elasticsearch, Elixir, Exposed, Figma, Firebase, Flask, Fleet, Gensim, Git, Go, Google tools, GPG, Gradle, HCL, HTML, Huggingface Transformers, iMovie, IntelliJ Platform, Java, JavaScript, JCEF, Jetpack Compose, Kotest, Kotlin, Kotlin MPP, Kotlinc, KotlinJS, Ktlint, Ktor.io, Kubeflow, Kubernetes, Markdown, Material UI, MobX, MSBuild, MySQL, Nats, NoriaUI, Objective C, OpenCV, Phoenix Framework, Photoshop, Pion, Principle, Python, PyTorch, React, ReactJS, Redux, REST, S3, Shell, Slack, SocketIO, JetBrains Space, Spring Boot, SQL, SVG, Swift, SwiftUI, Swing, TeamCity DSL, TensorFlow, Terraform, Tornado, TypeScript, Vanilla JS, Voice synthesizer, WebRequests, WebSocket, XML, YAML, Zendesk API.

JetBrains
The Drive to Develop

Continue ReadingJetBrains 8th Annual Hackathon: Home Edition

JetBrains at the ICPC North America Championship 2020

The first ICPC North America Championship (ICPC NAC 2020) took place February 19–23, 2020. The top teams from the ICPC North America Regional Contests advanced to the ICPC NAC in Atlanta, Georgia, hosted by the College of Computing at the Georgia Institute of Technology.

JetBrains was proud to be a Gold Sponsor of the event. We were also honored to receive an ICPC North America Outstanding Community Leadership Award for our three-year commitment to their North America Regional Contests, participation in the ICPC World Finals, and service as the official ICPC Global Programming Tools Sponsor. JetBrains was also recognized for our commitment to helping ICPC Global advance the art, science, and sport of programming through trustworthy competitions for universities all over the world for the benefit of society.

JetBrains_award

JetBrains was represented by members of the Educational Products and Kotlin teams, along with Andrey Ivanov, SVP of Investments, Research, and Education. We participated in different activities related to the event, and we also had a booth at the Career Fair, where we had an opportunity to speak with contestants and their coaches about best practices and tools in computer science and to discuss our open internship positions. Sebastian Aigner, JetBrains Developer Advocate in Education, gave a talk for the coaches about our Educational Products and JetBrains Academy, a hands-on platform for learning programming.

Sebastian_Aigner

He provided an overview of the features and capabilities of the platform and described their uses for learning and teaching programming.

One of our central goals at the ICPC North America Championship was to meet teams using Kotlin for competitions so that we could share their experiences and help make Kotlin, already one of the official ICPC languages, more popular for competitive programming.
Some teams, including the NAC winners from MIT, used Kotlin during the practice contest. One of their team members also later became the third-place winner of Kotlin Heroes 3.

The team from the Milwaukee School of Engineering (MSE) used Kotlin for every submission throughout the contests. We had a chat with team member Nick Johnson about the factors that make Kotlin a great choice for competitive programming. Here are some takeaways about why the team from MSE chooses Kotlin for their coding challenges:

  • What parts of Kotlin’s design make it a good contender for competitive programming?

    Kotlin is built to be easy to use and very intuitive. It’s like speaking a sentence out loud and putting it into code. Kotlin is a great functional language, incredibly strong for anything list-based, array-based, or map-based. It’s beneficial for manipulating copious amounts of data.
  • What advice would you give to other competitive programmers making the switch to Kotlin?

    There are a number of tricks in the language you can use to your advantage! For example:

    • Use functions inside function bodies to keep track of states easily.
    • When modifying any sort of data, put a dot after it and look at what IntelliJ suggests for auto-completion. There’s a good chance that it will suggest the change you’re looking for.
    • Sorting is an operation built into lists. You can choose a custom sort button, copy to other lists, or mutate certain parts of the data.
  • Why do you prefer Kotlin over other official ICPC languages?

    Well, it’s not quite that simple – there’s more than one reason:

      • Using Java is like tying chains to your feet for fun because of all its limitations, such as the extra code one needs to type or the extra things one needs to do to map or transform data. A Java solution can easily be 2 times longer than an equivalent Kotlin solution, without any runtime benefits.
      • ICPC is an algorithms contest, and while C++ is fast, functional elements of Kotlin, like operations on lists, make it easier to use for the contest than C++. There’s no need to type out three or four lines of code, as you must do in C++.
      • Looking at things like the standard library, Kotlin offers a lot more than Python, and does a lot of it better. The speed difference can be simply incredible: we’ve had solutions that our teammates wrote in Python and timed out, and with Kotlin we can solve the problem in 0.1 seconds just because that’s the nature of the language.

    I’m excited to see what other people can do once they start to use Kotlin and remove the shackles of whatever language they’re currently using.

  • Thank you for your insights, Nick!

And, of course, we can’t forget to mention the winner of ICPC NAC 2020, the MIT team. Congratulations to the team and its coach, and also to every participant of this great and unique event! We were happy to be there with you!

Awards_ceremony

Your JetBrains team

Continue ReadingJetBrains at the ICPC North America Championship 2020

What on Earth Was the JetBrains Quest?

We have a lot of developers at JetBrains, and many of us like games – challenging games. We came up with the idea of creating a treasure hunt in which the solution to each puzzle was the hint for the next one. We’d hide all the puzzles as easter eggs inside JetBrains sources. After a long period of brainstorming, JetBrains Quest was born.

JetBrains Quest was a series of puzzles spread throughout different JetBrains pages and products. The game consisted of 3 Quests, with 4-6 puzzles to solve per quest. The first quest was relatively easy to give people a chance to figure out what to expect with the difficulty increasing as you moved along. The Quest began on March 9 with a post on our social media networks (
Twitter, Facebook and Linkedin) and it ended on March 15 at 12:00 CET. At this point all of the puzzles were removed.

The response from the community was amazing!

Group_noblocks-2-2-2

Some of them struggled.Group_3_noblock-2-2-2

People were asking for more.Group_2_block-2

Based on the comments, it looks like the most difficult puzzle to solve was the Fibonacci exercise. This puzzle was hidden inside a Tip of the Day in a specific version of IntelliJ IDEA Community Edition.
final quest tip of the day

You have discovered our JetBrains Quest! If you don’t know what this is, you should start from the beginning.
This is it. The last puzzle. You are just one step away from glory!
Now you just need the Key to unlock the Quest page.
The Key is the first and last 4 digits of the 50 * 10^6 position of the Fibonacci sequence (F(50 Million)).
As you may know by now, not all that glitters is gold, and to solve this puzzle you should not go straight for the obvious answer. May you make a glorious choice.
Remember that you have until the 15th of March 12:00 CEST.

This was the last puzzle of the entire Quest. If you attempt to solve it using a linear approach, it will take hours or even days to get the answer. There were two main approaches to tackling this puzzle. The easy one was to use Wolfram|Alpha to get the first and last four digits.

The second way is more difficult, but it comes with a bonus: a bigger feeling of accomplishment! There are algorithms that make the computation for the Fibonacci sequence faster. We were expecting you to implement one of these options. Here’s an example:

import math
def last_fib_digits(fib_number, last_digits):
   prev, cur = 0, 1
   q = 10 ** last_digits
   while fib_number > 0:
       prev, cur = cur, prev + cur
       fib_number -= 1
       cur %= q
   return prev
def first_fib_digits(fib_number):
   phi = (math.pow(5.0, 0.5) + 1) / 2
   logF = fib_number * math.log10(phi) - 0.5 * math.log10(5.0)
   return math.pow(10.0, logF - int(logF))
print(last_fib_digits(50000000, 4))
print(first_fib_digits(50000000))

First 4 digits: 4602
Last 4 digits: 3125

For those of you who didn’t manage to finish the Quest, you can see all the puzzles and their solutions here.

We would like to thank everyone who took part in our JetBrains Quest and joined in the fun. Leave a comment below and let us know which puzzle was your favorite.

Thanks for joining in! May you always have an adventure in your life!
– The JetBrains Quest Team

Continue ReadingWhat on Earth Was the JetBrains Quest?

End of content

No more pages to load