Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
magicCards
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eray Düzenli
magicCards
Commits
fccefbb1
Commit
fccefbb1
authored
2 years ago
by
artemSaenger
Browse files
Options
Downloads
Patches
Plain Diff
a1 & a2
parent
27507179
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.idea/magicCards.iml
+1
-7
1 addition, 7 deletions
.idea/magicCards.iml
.idea/vcs.xml
+6
-0
6 additions, 0 deletions
.idea/vcs.xml
main.cpp
+60
-1
60 additions, 1 deletion
main.cpp
with
67 additions
and
8 deletions
.idea/magicCards.iml
+
1
−
7
View file @
fccefbb1
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"CPP_MODULE"
version=
"4"
>
<module
classpath=
"CMake"
type=
"CPP_MODULE"
version=
"4"
/>
<component
name=
"NewModuleRootManager"
>
\ No newline at end of file
<content
url=
"file://$MODULE_DIR$"
/>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
</module>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
.idea/vcs.xml
0 → 100644
+
6
−
0
View file @
fccefbb1
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
""
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
main.cpp
+
60
−
1
View file @
fccefbb1
#include
<iostream>
#include
<iostream>
#include
<cstring>
#include
<algorithm>
#include
<string>
class
Cards
{
public:
Cards
()
=
default
;
Cards
(
std
::
string
name
,
int
mana
,
int
cmc
,
std
::
string
type
,
int
count
)
:
m_name
(
std
::
move
(
name
)),
m_mana
(
mana
),
m_cmc
(
cmc
),
m_type
(
std
::
move
(
type
)),
m_count
(
count
)
{}
const
std
::
string
&
getName
()
const
{
return
m_name
;
}
int
getMana
()
const
{
return
m_mana
;
}
int
getCMC
()
const
{
return
m_cmc
;
}
const
std
::
string
&
getType
()
const
{
return
m_type
;
}
int
getCount
()
const
{
return
m_count
;
}
void
setName
(
const
std
::
string
&
name
)
{
m_name
=
name
;
}
void
setMana
(
int
mana
)
{
m_mana
=
mana
;
}
void
setCMC
(
int
cmc
)
{
m_cmc
=
cmc
;
}
void
setType
(
const
std
::
string
&
type
)
{
m_type
=
type
;
}
void
setCount
(
int
count
)
{
m_count
=
count
;
}
private
:
std
::
string
m_name
;
int
m_mana
;
int
m_cmc
;
std
::
string
m_type
;
int
m_count
;
};
int
levenshteinDistance
(
const
char
*
s1
,
const
char
*
s2
)
{
const
int
len1
=
std
::
strlen
(
s1
);
const
int
len2
=
std
::
strlen
(
s2
);
int
matrix
[
len1
+
1
][
len2
+
1
];
for
(
int
i
=
0
;
i
<=
len1
;
i
++
)
{
matrix
[
i
][
0
]
=
i
;
}
for
(
int
j
=
0
;
j
<=
len2
;
j
++
)
{
matrix
[
0
][
j
]
=
j
;
}
for
(
int
i
=
1
;
i
<=
len1
;
i
++
)
{
for
(
int
j
=
1
;
j
<=
len2
;
j
++
)
{
const
int
cost
=
(
s1
[
i
-
1
]
==
s2
[
j
-
1
])
?
0
:
1
;
matrix
[
i
][
j
]
=
std
::
min
({
matrix
[
i
-
1
][
j
]
+
1
,
matrix
[
i
][
j
-
1
]
+
1
,
matrix
[
i
-
1
][
j
-
1
]
+
cost
});
}
}
return
matrix
[
len1
][
len2
];
}
int
main
()
{
int
main
()
{
std
::
cout
<<
"Hello, World!"
<<
std
::
endl
;
const
char
*
str1
=
"kitten"
;
const
char
*
str2
=
"sitting"
;
const
int
distance
=
levenshteinDistance
(
str1
,
str2
);
std
::
cout
<<
distance
<<
std
::
endl
;
return
0
;
return
0
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment