I always use the exercism editor for the exrcises, when i got the time out error i tested it on cxxdroid and it worked as it should but when I tried it in the editor i get the time out error, is it my code or problem with the site. Here is my code:
rna_transcription.h
#if !defined(RNA_TRANSCRIPTION_H)
#define RNA_TRANSCRIPTION_H
#include <utility>
#include <string>
namespace rna_transcription
{
constexpr std::pair<std::string_view,std::string_view> dna_rna {“GCTA”,“CGAU”};
std::string to_rna(std::string_view dna_strand);
} // namespace rna_transcription
#endif // RNA_TRANSCRIPTION_H
trancription.cpp
#include “rna_transcription.h”
#include <cctype>
namespace rna_transcription
{
std::string to_rna(std::string_view dna_strand)
{
int index{};
std::string rna_strand{};
for(char i:dna_strand)
{
index = (dna_rna.first).find(std::toupper(i));
rna_strand += (dna_rna.second)[index];
}
return rna_strand;
}
} // namespace rna_transcription