The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [chemistry]

Related to chemistry or some aspect of chemistry

Filter by
Sorted by
Tagged with
18
votes
6answers
2k views

Electron Configurations

Electron Configurations Your mission is to accept an element's atomic number as input, and output its electron configuration (e.g. 2,8,8,2 for calcium). Input An ...
30
votes
6answers
8k views

Balance chemical equations!

Bernd is a high school student who has some problems in chemistry. In class he has to design chemical equations for some experiments they are doing, such as the combustion of heptane: C7H16 + 11O2 →...
28
votes
20answers
1k views

Number of Straight-Chain Alk*nes of given length

A straight-chain alk*ne is defined as a sequence of carbon atoms connected by single (alkane), double (alkene), or triple bonds (alkyne), (implicit hydrogens are used.) Carbon atoms can only form 4 ...
14
votes
7answers
883 views

Molar masses of compounds

Task Write a program that takes in a compound made solely of elements with an atomic number less than or equal to 92 (Uranium), and outputs the molar mass of the compound in ...
11
votes
7answers
2k views

Longest reverse palindromic DNA substring

As you may know, in DNA there are four bases — adenine (A), cytosine (C), guanine (G) and ...
28
votes
8answers
2k views

Codeium Golfide

In this challenge, your task is to take an anion and a cation, and output the chemical formula of the compound. The input follows these rules: Take in 2 strings (in any order) representing the anion ...
20
votes
3answers
747 views

[Br]eaking Code Golf [Ba]d

Consider the following string: Tin Snips This string contains several atomic symbols on the periodic table. We could rewrite this string to identify several of ...
17
votes
1answer
687 views

Drawing Lewis Structures of Alkanes

I just had a lesson in school about alkanes and figured it would probably make for a great code golf challenge! Don't worry, it isn't as complicated as it may look! A Quick Rehash (Please Note: To ...
14
votes
10answers
2k views

Let's learn some soil pH chemistry!

Andrew is a chemist, interested in the acidity of solutions and in agriculture. After months of research (Google is not his friend), he came up with the following table* regarding the human-readable ...
17
votes
7answers
1k views

Electron Configuration

In atomic physics and quantum chemistry, the electron configuration is the distribution of electrons of an atom in atomic orbitals. For example, the electron configuration of the neon atom is 1s2 2s2 ...
8
votes
3answers
276 views

Build a Mass Spectrometer!

Challenge Given the high resolution molecular mass of an organic molecule, output the molecule's molecular formula. Explanation The input will be a single number to three decimal places of ...
13
votes
3answers
1k views

Electron Configuration Diagrams

Challenge Given an element name, output its electron configuration. Input Your input will be the full name of each element (the range being from Hydrogen, 1, to Calcium, 20) with some exceptions - ...
44
votes
12answers
3k views

Molecules to Atoms

The Challenge Write a program that can break down an input chemical formula (see below), and output its respective atoms in the form element: atom-count. Input ...
16
votes
4answers
469 views

An elementary challenge

This challenge is inspired by this Oliver Sacks quote: “At 11, I could say ‘I am sodium’ (Element 11), and now at 79, I am gold.” ― Oliver Sacks I want you you find numbers in a string and ...
12
votes
8answers
909 views

Chemical sentences! Decrypting [duplicate]

Background You are sitting in chemistry class and your friend keep sending you these strange letters. It is your job to decrypt the messages into words. This is the inverse of this challenge. The ...
2
votes
0answers
119 views

Chemical sentences! Encrypting [duplicate]

Background You are bored in class, and having exhausted all the possible things to write on a standard calculator (Like 8008135) you turn to the periodic table. You want to figure out if you can ...